You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by sf...@apache.org on 2011/04/24 13:34:49 UTC
svn commit: r1096313 [2/2] - in /chemistry/opencmis/trunk: ./
chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/
chemistry-opencmis-client/chemistry-opencmis-cli...
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractTransientObjectIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractTransientObjectIT.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractTransientObjectIT.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractTransientObjectIT.java Sun Apr 24 11:34:48 2011
@@ -26,7 +26,6 @@ import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@@ -44,201 +43,210 @@ import org.apache.chemistry.opencmis.com
import org.junit.Test;
public abstract class AbstractTransientObjectIT extends AbstractSessionTest {
- @Test
- public void transientUpdate() throws Exception {
- ObjectId parentId = this.session.createObjectId(this.fixture
- .getTestRootId());
- String filename1 = UUID.randomUUID().toString();
- String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, filename1);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- String mimetype = "text/html; charset=UTF-8";
- String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
-
- byte[] buf1 = content1.getBytes("UTF-8");
- ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream1 = this.session.getObjectFactory()
- .createContentStream(filename1, buf1.length, mimetype, in1);
- assertNotNull(contentStream1);
-
- ObjectId id = this.session.createDocument(properties, parentId,
- contentStream1, VersioningState.NONE);
- assertNotNull(id);
-
- // prepare new non-cache operation context
- OperationContext oc = this.session.createOperationContext();
- oc.setFilterString("*");
- oc.setCacheEnabled(false);
-
- // set new name and save
- Document doc2 = (Document) this.session.getObject(id, oc);
- TransientDocument tdoc2 = doc2.getTransientDocument();
-
- assertEquals(filename1, tdoc2.getName());
-
- ContentStream cs2 = tdoc2.getContentStream();
- assertNotNull(cs2);
- assertContent(buf1, readContent(cs2));
-
- String filename2 = UUID.randomUUID().toString();
- tdoc2.setName(filename2);
- assertEquals(filename2, tdoc2.getName());
-
- ObjectId id2 = tdoc2.save();
- assertNotNull(id2);
-
- // set new content and save
- Document doc3 = (Document) this.session.getObject(id2, oc);
- TransientDocument tdoc3 = doc3.getTransientDocument();
-
- assertEquals(filename2, tdoc3.getName());
-
- ContentStream cs3 = tdoc3.getContentStream();
- assertNotNull(cs3);
- assertContent(buf1, readContent(cs3));
-
- String content3 = "Es rauscht noch.";
-
- byte[] buf3 = content3.getBytes("UTF-8");
- ByteArrayInputStream in3 = new ByteArrayInputStream(buf3);
- ContentStream contentStream3 = this.session.getObjectFactory()
- .createContentStream(tdoc3.getName(), buf3.length, mimetype,
- in3);
- assertNotNull(contentStream3);
-
- tdoc3.setContentStream(contentStream3, true);
-
- ObjectId id3 = tdoc3.save();
- assertNotNull(id3);
-
- // set new name, delete content and save
- Document doc4 = (Document) this.session.getObject(id3, oc);
- TransientDocument tdoc4 = doc4.getTransientDocument();
-
- assertEquals(tdoc3.getName(), tdoc4.getName());
-
- ContentStream cs4 = tdoc4.getContentStream();
- assertNotNull(cs4);
- assertContent(buf3, readContent(cs4));
-
- String filename4 = UUID.randomUUID().toString();
- tdoc4.setName(filename4);
- assertEquals(filename4, tdoc4.getName());
-
- tdoc4.deleteContentStream();
-
- ObjectId id4 = tdoc4.save();
- assertNotNull(id4);
-
- // delete object
- Document doc5 = (Document) this.session.getObject(id4, oc);
- TransientDocument tdoc5 = doc5.getTransientDocument();
-
- assertEquals(filename4, tdoc5.getName());
-
- ContentStream cs5 = tdoc4.getContentStream();
- assertNull(cs5);
-
- assertEquals(false, tdoc5.isMarkedForDelete());
-
- tdoc5.delete(true);
-
- assertEquals(true, tdoc5.isMarkedForDelete());
-
- ObjectId id5 = tdoc5.save();
- assertNull(id5);
-
- // check
- try {
- this.session.getObject(id4, oc);
- fail("CmisObjectNotFoundException expected!");
- } catch (CmisObjectNotFoundException e) {
- // expected
- }
- }
-
- @Test
- public void transientFolderSessionCheck() throws UnsupportedEncodingException {
- String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.FOLDER1_NAME;
- Folder folder1 = (Folder) this.session.getObjectByPath(path);
- assertNotNull("folder not found: " + path, folder1);
-
- TransientFolder tfolder = folder1.getTransientFolder();
- assertNotNull(tfolder);
-
- String newFolderName = UUID.randomUUID().toString();
- tfolder.setPropertyValue(PropertyIds.NAME, newFolderName);
-
- Folder folder2 = (Folder) this.session2.getObjectByPath(path);
- assertNotNull(folder2);
- assertEquals(folder2.getProperty(PropertyIds.NAME).getValueAsString(), FixtureData.FOLDER1_NAME.toString());
- assertEquals(tfolder.getProperty(PropertyIds.NAME).getValueAsString(), newFolderName);
-
- tfolder.save();
- session2.clear();
-
- ObjectId id = this.session2.createObjectId(tfolder.getId());
-
- Folder folder3 = (Folder) this.session2.getObject(id);
- assertNotNull(folder3);
- assertEquals(folder3.getProperty(PropertyIds.NAME).getValueAsString(), newFolderName);
- }
-
- @Test
- public void transientDocumentSessionCheck() throws UnsupportedEncodingException {
- String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document1 = (Document) this.session.getObjectByPath(path);
- assertNotNull("document not found: " + path, document1);
-
- TransientDocument tdoc = document1.getTransientDocument();
- assertNotNull(tdoc);
-
- String newDocName = UUID.randomUUID().toString();
- tdoc.setPropertyValue(PropertyIds.NAME, newDocName);
-
- Document doc2 = (Document) this.session2.getObjectByPath(path);
- assertNotNull(doc2);
- assertEquals(doc2.getProperty(PropertyIds.NAME).getValueAsString(), FixtureData.DOCUMENT1_NAME.toString());
- assertEquals(tdoc.getProperty(PropertyIds.NAME).getValueAsString(), newDocName);
-
- tdoc.save();
- session2.clear();
-
- ObjectId id = this.session2.createObjectId(tdoc.getId());
-
- Document doc3 = (Document) this.session2.getObject(id);
- assertNotNull(doc3);
- assertEquals(doc3.getProperty(PropertyIds.NAME).getValueAsString(), newDocName);
- }
-
-
- private byte[] readContent(ContentStream contentStream) throws Exception {
- assertNotNull(contentStream);
- assertNotNull(contentStream.getStream());
-
- InputStream stream = contentStream.getStream();
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- byte[] buffer = new byte[4096];
- int b;
- while ((b = stream.read(buffer)) > -1) {
- baos.write(buffer, 0, b);
- }
-
- return baos.toByteArray();
- }
-
- private void assertContent(byte[] expected, byte[] actual) {
- assertNotNull(expected);
- assertNotNull(actual);
-
- assertEquals("Content size:", expected.length, actual.length);
-
- for (int i = 0; i < expected.length; i++) {
- assertEquals("Content not equal.", expected[i], actual[i]);
- }
- }
+
+ @Test
+ public void transientUpdate() throws Exception {
+ ObjectId parentId = session
+ .createObjectId(this.fixture.getTestRootId());
+ String filename1 = UUID.randomUUID().toString();
+ String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, filename1);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ String mimetype = "text/html; charset=UTF-8";
+ String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
+
+ byte[] buf1 = content1.getBytes("UTF-8");
+ ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
+ ContentStream contentStream1 = session.getObjectFactory()
+ .createContentStream(filename1, buf1.length, mimetype, in1);
+ assertNotNull(contentStream1);
+
+ ObjectId id = session.createDocument(properties, parentId,
+ contentStream1, VersioningState.NONE);
+ assertNotNull(id);
+
+ // prepare new non-cache operation context
+ OperationContext oc = session.createOperationContext();
+ oc.setFilterString("*");
+ oc.setCacheEnabled(false);
+
+ // set new name and save
+ Document doc2 = (Document) session.getObject(id, oc);
+ TransientDocument tdoc2 = doc2.getTransientDocument();
+
+ assertEquals(filename1, tdoc2.getName());
+
+ ContentStream cs2 = tdoc2.getContentStream();
+ assertNotNull(cs2);
+ assertContent(buf1, readContent(cs2));
+
+ String filename2 = UUID.randomUUID().toString();
+ tdoc2.setName(filename2);
+ assertEquals(filename2, tdoc2.getName());
+
+ ObjectId id2 = tdoc2.save();
+ assertNotNull(id2);
+
+ // set new content and save
+ Document doc3 = (Document) session.getObject(id2, oc);
+ TransientDocument tdoc3 = doc3.getTransientDocument();
+
+ assertEquals(filename2, tdoc3.getName());
+
+ ContentStream cs3 = tdoc3.getContentStream();
+ assertNotNull(cs3);
+ assertContent(buf1, readContent(cs3));
+
+ String content3 = "Es rauscht noch.";
+
+ byte[] buf3 = content3.getBytes("UTF-8");
+ ByteArrayInputStream in3 = new ByteArrayInputStream(buf3);
+ ContentStream contentStream3 = session.getObjectFactory()
+ .createContentStream(tdoc3.getName(), buf3.length, mimetype,
+ in3);
+ assertNotNull(contentStream3);
+
+ tdoc3.setContentStream(contentStream3, true);
+
+ ObjectId id3 = tdoc3.save();
+ assertNotNull(id3);
+
+ // set new name, delete content and save
+ Document doc4 = (Document) session.getObject(id3, oc);
+ TransientDocument tdoc4 = doc4.getTransientDocument();
+
+ assertEquals(tdoc3.getName(), tdoc4.getName());
+
+ ContentStream cs4 = tdoc4.getContentStream();
+ assertNotNull(cs4);
+ assertContent(buf3, readContent(cs4));
+
+ String filename4 = UUID.randomUUID().toString();
+ tdoc4.setName(filename4);
+ assertEquals(filename4, tdoc4.getName());
+
+ tdoc4.deleteContentStream();
+
+ ObjectId id4 = tdoc4.save();
+ assertNotNull(id4);
+
+ // delete object
+ Document doc5 = (Document) session.getObject(id4, oc);
+ TransientDocument tdoc5 = doc5.getTransientDocument();
+
+ assertEquals(filename4, tdoc5.getName());
+
+ ContentStream cs5 = tdoc4.getContentStream();
+ assertNull(cs5);
+
+ assertEquals(false, tdoc5.isMarkedForDelete());
+
+ tdoc5.delete(true);
+
+ assertEquals(true, tdoc5.isMarkedForDelete());
+
+ ObjectId id5 = tdoc5.save();
+ assertNull(id5);
+
+ // check
+ try {
+ this.session.getObject(id4, oc);
+ fail("CmisObjectNotFoundException expected!");
+ } catch (CmisObjectNotFoundException e) {
+ // expected
+ }
+ }
+
+ @Test
+ public void transientFolderSessionCheck() {
+ String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/"
+ + FixtureData.FOLDER1_NAME;
+ Folder folder1 = (Folder) session.getObjectByPath(path);
+ assertNotNull("folder not found: " + path, folder1);
+
+ TransientFolder tfolder = folder1.getTransientFolder();
+ assertNotNull(tfolder);
+
+ String newFolderName = UUID.randomUUID().toString();
+ tfolder.setPropertyValue(PropertyIds.NAME, newFolderName);
+
+ Folder folder2 = (Folder) session2.getObjectByPath(path);
+ assertNotNull(folder2);
+ assertEquals(folder2.getProperty(PropertyIds.NAME).getValueAsString(),
+ FixtureData.FOLDER1_NAME.toString());
+ assertEquals(tfolder.getProperty(PropertyIds.NAME).getValueAsString(),
+ newFolderName);
+
+ tfolder.save();
+ session2.clear();
+
+ ObjectId id = session2.createObjectId(tfolder.getId());
+
+ Folder folder3 = (Folder) session2.getObject(id);
+ assertNotNull(folder3);
+ assertEquals(folder3.getProperty(PropertyIds.NAME).getValueAsString(),
+ newFolderName);
+ }
+
+ @Test
+ public void transientDocumentSessionCheck() {
+ String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/"
+ + FixtureData.DOCUMENT1_NAME;
+ Document document1 = (Document) session.getObjectByPath(path);
+ assertNotNull("document not found: " + path, document1);
+
+ TransientDocument tdoc = document1.getTransientDocument();
+ assertNotNull(tdoc);
+
+ String newDocName = UUID.randomUUID().toString();
+ tdoc.setPropertyValue(PropertyIds.NAME, newDocName);
+
+ Document doc2 = (Document) session2.getObjectByPath(path);
+ assertNotNull(doc2);
+ assertEquals(doc2.getProperty(PropertyIds.NAME).getValueAsString(),
+ FixtureData.DOCUMENT1_NAME.toString());
+ assertEquals(tdoc.getProperty(PropertyIds.NAME).getValueAsString(),
+ newDocName);
+
+ tdoc.save();
+ session2.clear();
+
+ ObjectId id = session2.createObjectId(tdoc.getId());
+
+ Document doc3 = (Document) session2.getObject(id);
+ assertNotNull(doc3);
+ assertEquals(doc3.getProperty(PropertyIds.NAME).getValueAsString(),
+ newDocName);
+ }
+
+ private static byte[] readContent(ContentStream contentStream)
+ throws Exception {
+ assertNotNull(contentStream);
+ assertNotNull(contentStream.getStream());
+
+ InputStream stream = contentStream.getStream();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ byte[] buffer = new byte[4096];
+ int b;
+ while ((b = stream.read(buffer)) > -1) {
+ baos.write(buffer, 0, b);
+ }
+
+ return baos.toByteArray();
+ }
+
+ private static void assertContent(byte[] expected, byte[] actual) {
+ assertNotNull(expected);
+ assertNotNull(actual);
+
+ assertEquals("Content size:", expected.length, actual.length);
+
+ for (int i = 0; i < expected.length; i++) {
+ assertEquals("Content not equal.", expected[i], actual[i]);
+ }
+ }
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java Sun Apr 24 11:34:48 2011
@@ -43,7 +43,7 @@ public abstract class AbstractWriteObjec
@Test
public void createFolder() {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ ObjectId parentId = session.createObjectId(fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.FOLDER_TYPE_ID.value();
@@ -51,13 +51,13 @@ public abstract class AbstractWriteObjec
properties.put(PropertyIds.NAME, folderName);
properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
- ObjectId id = this.session.createFolder(properties, parentId);
+ ObjectId id = session.createFolder(properties, parentId);
assertNotNull(id);
}
@Test
public void createDocument() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ ObjectId parentId = session.createObjectId(fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
@@ -71,27 +71,27 @@ public abstract class AbstractWriteObjec
byte[] buf1 = content1.getBytes("UTF-8");
ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
+ ContentStream contentStream = session.getObjectFactory().createContentStream(filename, buf1.length,
mimetype, in1);
assertNotNull(contentStream);
- ObjectId id = this.session.createDocument(properties, parentId, contentStream, VersioningState.NONE);
+ ObjectId id = session.createDocument(properties, parentId, contentStream, VersioningState.NONE);
assertNotNull(id);
// verify content
- Document doc = (Document) this.session.getObject(id);
+ Document doc = (Document) session.getObject(id);
assertNotNull(doc);
// Assert.assertEquals(buf1.length, doc.getContentStreamLength());
// Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
// Assert.assertEquals(filename, doc.getContentStreamFileName());
- String content2 = this.getContentAsString(doc.getContentStream());
+ String content2 = getContentAsString(doc.getContentStream());
assertEquals(content1, content2);
}
@Test
@Ignore
- public void createHugeDocument() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ public void createHugeDocument() {
+ ObjectId parentId = session.createObjectId(fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
@@ -102,11 +102,11 @@ public abstract class AbstractWriteObjec
String filename = UUID.randomUUID().toString();
String mimetype = "application/octet-stream";
- ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE);
+ ObjectId id = session.createDocument(properties, parentId, null, VersioningState.NONE);
assertNotNull(id);
// verify content
- Document doc = (Document) this.session.getObject(id);
+ Document doc = (Document) session.getObject(id);
assertNotNull(doc);
final int size = 1 * 1024 * 1024 * 1024; // 1GB
@@ -126,7 +126,7 @@ public abstract class AbstractWriteObjec
}
};
- ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, size, mimetype, in);
+ ContentStream contentStream = session.getObjectFactory().createContentStream(filename, size, mimetype, in);
assertNotNull(contentStream);
long start = System.currentTimeMillis();
@@ -141,26 +141,26 @@ public abstract class AbstractWriteObjec
try {
// verify content
String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document srcDocument = (Document) this.session.getObjectByPath(path);
+ Document srcDocument = (Document) session.getObjectByPath(path);
assertNotNull("Document not found: " + path, srcDocument);
- String srcContent = this.getContentAsString(srcDocument.getContentStream());
+ String srcContent = getContentAsString(srcDocument.getContentStream());
- ObjectId parentFolder = session.createObjectId(this.fixture.getTestRootId());
+ ObjectId parentFolder = session.createObjectId(fixture.getTestRootId());
String name = UUID.randomUUID().toString();
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, name);
- ObjectId dstDocumentId = this.session.createDocumentFromSource(srcDocument, properties, parentFolder,
+ ObjectId dstDocumentId = session.createDocumentFromSource(srcDocument, properties, parentFolder,
VersioningState.NONE);
assertNotNull(dstDocumentId);
- Document dstDocument = (Document) this.session.getObject(dstDocumentId);
- String dstContent = this.getContentAsString(dstDocument.getContentStream());
+ Document dstDocument = (Document) session.getObject(dstDocumentId);
+ String dstContent = getContentAsString(dstDocument.getContentStream());
assertEquals(srcContent, dstContent);
} catch (CmisNotSupportedException e) {
// not an error
- this.log.info(e.getMessage());
+ log.info(e.getMessage());
}
}
@@ -169,13 +169,13 @@ public abstract class AbstractWriteObjec
// verify content
String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document = (Document) this.session.getObjectByPath(path);
+ Document document = (Document) session.getObjectByPath(path);
assertNotNull("Document not found: " + path, document);
// check default content
ContentStream contentStream = document.getContentStream();
assertNotNull(contentStream);
- String contentString = this.getContentAsString(contentStream);
+ String contentString = getContentAsString(contentStream);
assertNotNull(contentString);
// delete and set new content
@@ -189,7 +189,7 @@ public abstract class AbstractWriteObjec
byte[] buf1 = content1.getBytes("UTF-8");
ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length, mimetype, in1);
+ contentStream = session.getObjectFactory().createContentStream(filename, buf1.length, mimetype, in1);
assertNotNull(contentStream);
document.setContentStream(contentStream, true);
@@ -197,7 +197,7 @@ public abstract class AbstractWriteObjec
// check default content
ContentStream contentStream2 = document.getContentStream();
assertNotNull(contentStream2);
- String contentString2 = this.getContentAsString(contentStream2);
+ String contentString2 = getContentAsString(contentStream2);
assertNotNull(contentString2);
assertEquals(content1, contentString2);
@@ -207,7 +207,7 @@ public abstract class AbstractWriteObjec
public void updateProperties() {
// verify content
String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document = (Document) this.session.getObjectByPath(path);
+ Document document = (Document) session.getObjectByPath(path);
assertNotNull("Document not found: " + path, document);
// TODO: adapt test to refactored interface
@@ -220,7 +220,7 @@ public abstract class AbstractWriteObjec
public void updateSinglePropertyAndCheckName() {
// verify content
String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document = (Document) this.session.getObjectByPath(path);
+ Document document = (Document) session.getObjectByPath(path);
assertNotNull("Document not found: " + path, document);
String value = UUID.randomUUID().toString();
@@ -246,11 +246,11 @@ public abstract class AbstractWriteObjec
String s3 = p.getFirstValue();
assertEquals(s1, s3);
- Document document2 = (Document) this.session.getObjectByPath(path);
+ Document document2 = (Document) session.getObjectByPath(path);
assertNotNull("Document not found: " + path, document2);
}
- private String getContentAsString(ContentStream stream) throws IOException {
+ private static String getContentAsString(ContentStream stream) throws IOException {
assertNotNull(stream);
InputStream in2 = stream.getStream();
assertNotNull(in2);
@@ -269,7 +269,7 @@ public abstract class AbstractWriteObjec
@Test
public void createDocumentAndSetContent() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ ObjectId parentId = session.createObjectId(fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
@@ -283,15 +283,15 @@ public abstract class AbstractWriteObjec
byte[] buf1 = content1.getBytes("UTF-8");
ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
+ ContentStream contentStream = session.getObjectFactory().createContentStream(filename, buf1.length,
mimetype, in1);
assertNotNull(contentStream);
- ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE);
+ ObjectId id = session.createDocument(properties, parentId, null, VersioningState.NONE);
assertNotNull(id);
// set and verify content
- Document doc = (Document) this.session.getObject(id);
+ Document doc = (Document) session.getObject(id);
assertNotNull(doc);
doc.setContentStream(contentStream, true);
@@ -299,14 +299,14 @@ public abstract class AbstractWriteObjec
assertEquals(buf1.length, doc.getContentStreamLength());
assertEquals(mimetype, doc.getContentStreamMimeType());
assertEquals(filename, doc.getContentStreamFileName());
- String content2 = this.getContentAsString(doc.getContentStream());
+ String content2 = getContentAsString(doc.getContentStream());
assertEquals(content1, content2);
}
@Ignore
@Test
public void createDocumentAndSetContentNoOverwrite() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ ObjectId parentId = session.createObjectId(fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
@@ -320,15 +320,15 @@ public abstract class AbstractWriteObjec
byte[] buf1 = content1.getBytes("UTF-8");
ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
+ ContentStream contentStream = session.getObjectFactory().createContentStream(filename, buf1.length,
mimetype, in1);
assertNotNull(contentStream);
- ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE);
+ ObjectId id = session.createDocument(properties, parentId, null, VersioningState.NONE);
assertNotNull(id);
// set and verify content
- Document doc = (Document) this.session.getObject(id);
+ Document doc = (Document) session.getObject(id);
assertNotNull(doc);
doc.setContentStream(contentStream, false);
@@ -336,13 +336,13 @@ public abstract class AbstractWriteObjec
assertEquals(buf1.length, doc.getContentStreamLength());
assertEquals(mimetype, doc.getContentStreamMimeType());
assertEquals(filename, doc.getContentStreamFileName());
- String content2 = this.getContentAsString(doc.getContentStream());
+ String content2 = getContentAsString(doc.getContentStream());
assertEquals(content1, content2);
}
@Test
public void createDocumentAndUpdateContent() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ ObjectId parentId = session.createObjectId(fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
@@ -356,11 +356,11 @@ public abstract class AbstractWriteObjec
byte[] buf1 = content1.getBytes("UTF-8");
ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream1 = this.session.getObjectFactory().createContentStream(filename1, buf1.length,
+ ContentStream contentStream1 = session.getObjectFactory().createContentStream(filename1, buf1.length,
mimetype, in1);
assertNotNull(contentStream1);
- ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE);
+ ObjectId id = session.createDocument(properties, parentId, contentStream1, VersioningState.NONE);
assertNotNull(id);
// set and verify content
@@ -369,11 +369,11 @@ public abstract class AbstractWriteObjec
byte[] buf2 = content2.getBytes("UTF-8");
ByteArrayInputStream in2 = new ByteArrayInputStream(buf2);
- ContentStream contentStream2 = this.session.getObjectFactory().createContentStream(filename2, buf2.length,
+ ContentStream contentStream2 = session.getObjectFactory().createContentStream(filename2, buf2.length,
mimetype, in2);
assertNotNull(contentStream2);
- Document doc = (Document) this.session.getObject(id);
+ Document doc = (Document) session.getObject(id);
assertNotNull(doc);
doc.setContentStream(contentStream2, true);
@@ -381,14 +381,14 @@ public abstract class AbstractWriteObjec
assertEquals(buf2.length, doc.getContentStreamLength());
assertEquals(mimetype, doc.getContentStreamMimeType());
assertEquals(filename2, doc.getContentStreamFileName());
- String content3 = this.getContentAsString(doc.getContentStream());
+ String content3 = getContentAsString(doc.getContentStream());
assertEquals(content2, content3);
}
@Ignore
@Test(expected = CmisContentAlreadyExistsException.class)
public void createDocumentAndUpdateContentNoOverwrite() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ ObjectId parentId = session.createObjectId(fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
@@ -402,11 +402,11 @@ public abstract class AbstractWriteObjec
byte[] buf1 = content1.getBytes("UTF-8");
ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream1 = this.session.getObjectFactory().createContentStream(filename1, buf1.length,
+ ContentStream contentStream1 = session.getObjectFactory().createContentStream(filename1, buf1.length,
mimetype, in1);
assertNotNull(contentStream1);
- ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE);
+ ObjectId id = session.createDocument(properties, parentId, contentStream1, VersioningState.NONE);
assertNotNull(id);
// set and verify content
@@ -415,11 +415,11 @@ public abstract class AbstractWriteObjec
byte[] buf2 = content2.getBytes("UTF-8");
ByteArrayInputStream in2 = new ByteArrayInputStream(buf2);
- ContentStream contentStream2 = this.session.getObjectFactory().createContentStream(filename2, buf2.length,
+ ContentStream contentStream2 = session.getObjectFactory().createContentStream(filename2, buf2.length,
mimetype, in2);
assertNotNull(contentStream2);
- Document doc = (Document) this.session.getObject(id);
+ Document doc = (Document) session.getObject(id);
assertNotNull(doc);
doc.setContentStream(contentStream2, false);
@@ -427,7 +427,7 @@ public abstract class AbstractWriteObjec
assertEquals(buf2.length, doc.getContentStreamLength());
assertEquals(mimetype, doc.getContentStreamMimeType());
assertEquals(filename2, doc.getContentStreamFileName());
- String content3 = this.getContentAsString(doc.getContentStream());
+ String content3 = getContentAsString(doc.getContentStream());
assertEquals(content2, content3);
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureData.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureData.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureData.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureData.java Sun Apr 24 11:34:48 2011
@@ -21,60 +21,68 @@ package org.apache.chemistry.opencmis.fi
import java.util.Map;
public enum FixtureData {
- FOLDER_TYPE_ID("org.apache.chemistry.opencmis.fit.runtime.folder.type.id",
- "cmis:folder"), DOCUMENT_TYPE_ID(
- "org.apache.chemistry.opencmis.fit.runtime.document.type.id",
- "cmis:document"), QUERY(
- "org.apache.chemistry.opencmis.fit.runtime.query",
- "SELECT * FROM cmis:document"), PROPERTY_FILTER(
- "org.apache.chemistry.opencmis.fit.runtime.property.filter", "*"), FOLDER1_NAME(
- "org.apache.chemistry.opencmis.fit.runtime.folder1.name", "folder1"), FOLDER2_NAME(
- "org.apache.chemistry.opencmis.fit.runtime.folder2.name", "folder2"), DOCUMENT1_NAME(
- "org.apache.chemistry.opencmis.fit.runtime.document1.name",
- "document1.txt"), DOCUMENT2_NAME(
- "org.apache.chemistry.opencmis.fit.runtime.document2.name",
- "document2.txt"),
- PROPERTY_NAME_STRING_MULTI_VALUED("org.apache.chemistry.opencmis.fit.runtime.multi.valued.property.name", null);
+ FOLDER_TYPE_ID("org.apache.chemistry.opencmis.fit.runtime.folder.type.id",
+ "cmis:folder"),
+ DOCUMENT_TYPE_ID("org.apache.chemistry.opencmis.fit.runtime.document.type.id",
+ "cmis:document"),
+ QUERY("org.apache.chemistry.opencmis.fit.runtime.query",
+ "SELECT * FROM cmis:document"),
+ PROPERTY_FILTER(
+ "org.apache.chemistry.opencmis.fit.runtime.property.filter", "*"),
+ FOLDER1_NAME(
+ "org.apache.chemistry.opencmis.fit.runtime.folder1.name", "folder1"),
+ FOLDER2_NAME(
+ "org.apache.chemistry.opencmis.fit.runtime.folder2.name", "folder2"),
+ DOCUMENT1_NAME(
+ "org.apache.chemistry.opencmis.fit.runtime.document1.name",
+ "document1.txt"),
+ DOCUMENT2_NAME(
+ "org.apache.chemistry.opencmis.fit.runtime.document2.name",
+ "document2.txt"),
+ PROPERTY_NAME_STRING_MULTI_VALUED(
+ "org.apache.chemistry.opencmis.fit.runtime.multi.valued.property.name",
+ null);
private final String key;
- private String value;
+ private String value;
- FixtureData(String key, String value) {
- this.key = key;
- this.value = value;
- }
-
- public String value() {
- return this.value;
- }
-
- public static void changeValues(Map<String, String> map) {
- for (FixtureData fd : FixtureData.values()) {
- String v = map.get(fd.key);
- if (v != null) {
- fd.changeValue(v);
- }
- }
- }
-
- public static FixtureData get(String key) {
- for (FixtureData fd : FixtureData.values()) {
- if (fd.key.equals(key)) {
- return fd;
- }
- }
- throw new IllegalArgumentException(key);
- }
-
- void changeValue(String newValue) {
- this.value = newValue;
- }
-
- public String toString() {
- return this.value();
- }
-
- public String key() {
- return this.key;
- }
+ FixtureData(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public String value() {
+ return this.value;
+ }
+
+ public static void changeValues(Map<String, String> map) {
+ for (FixtureData fd : FixtureData.values()) {
+ String v = map.get(fd.key);
+ if (v != null) {
+ fd.changeValue(v);
+ }
+ }
+ }
+
+ public static FixtureData get(String key) {
+ for (FixtureData fd : FixtureData.values()) {
+ if (fd.key.equals(key)) {
+ return fd;
+ }
+ }
+ throw new IllegalArgumentException(key);
+ }
+
+ void changeValue(String newValue) {
+ this.value = newValue;
+ }
+
+ @Override
+ public String toString() {
+ return this.value();
+ }
+
+ public String key() {
+ return this.key;
+ }
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/TransientObjectAtomPubIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/TransientObjectAtomPubIT.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/TransientObjectAtomPubIT.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/TransientObjectAtomPubIT.java Sun Apr 24 11:34:48 2011
@@ -23,9 +23,9 @@ import org.apache.chemistry.opencmis.fit
public class TransientObjectAtomPubIT extends AbstractTransientObjectIT {
- @Override
- public void initFixture(Fixture fixture) {
+ @Override
+ public void initFixture(Fixture fixture) {
fixture.enableAtomPub();
- }
+ }
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/TransientObjectWebServicesIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/TransientObjectWebServicesIT.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/TransientObjectWebServicesIT.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/TransientObjectWebServicesIT.java Sun Apr 24 11:34:48 2011
@@ -23,9 +23,9 @@ import org.apache.chemistry.opencmis.fit
public class TransientObjectWebServicesIT extends AbstractTransientObjectIT {
- @Override
- public void initFixture(Fixture fixture) {
- fixture.enableWebServices();
- }
+ @Override
+ public void initFixture(Fixture fixture) {
+ fixture.enableWebServices();
+ }
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java Sun Apr 24 11:34:48 2011
@@ -39,9 +39,9 @@ import org.junit.Test;
/**
* Sample test case that demonstrates how to build integration tests.
- *
+ *
* @author <a href="mailto:fmueller@opentext.com">Florian Müller</a>
- *
+ *
*/
public abstract class AbstractSampleIT {
@@ -149,7 +149,7 @@ public abstract class AbstractSampleIT {
/**
* Checks a base type.
*/
- private void checkBaseType(String id, BaseTypeId baseType, ObjectType objectType) {
+ private static void checkBaseType(String id, BaseTypeId baseType, ObjectType objectType) {
assertNotNull(objectType);
if (id != null) {
assertEquals(id, objectType.getId());
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java Sun Apr 24 11:34:48 2011
@@ -46,7 +46,7 @@ public class CmisTckAntTask extends Task
private String format;
@Override
- public void init() throws BuildException {
+ public void init() {
super.init();
parameters = null;
groups = null;
@@ -71,7 +71,7 @@ public class CmisTckAntTask extends Task
}
@Override
- public void execute() throws BuildException {
+ public void execute() {
try {
AntRunner runner = new AntRunner();
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java Sun Apr 24 11:34:48 2011
@@ -61,7 +61,7 @@ public class SecurityTest extends Abstra
}
}
- private boolean isHttpsUrl(String url) {
+ private static boolean isHttpsUrl(String url) {
if (url == null) {
return false;
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Commander.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Commander.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Commander.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Commander.java Sun Apr 24 11:34:48 2011
@@ -33,9 +33,9 @@ import org.apache.chemistry.opencmis.com
/**
* Commander tool main.
- *
+ *
* @author <a href="mailto:fmueller@opentext.com">Florian Müller</a>
- *
+ *
*/
public class Commander {
@@ -92,7 +92,7 @@ public class Commander {
/**
* Prints usage.
*/
- private void printUsage(PrintWriter output) {
+ private static void printUsage(PrintWriter output) {
output.println("CMIS Commander\n");
output.println("Usage: Commander <config file> <command>\n");
output.println("Available commands:");
@@ -106,7 +106,7 @@ public class Commander {
/**
* Creates the provider object
*/
- private CmisBinding createBinding(String configFile) throws Exception {
+ private static CmisBinding createBinding(String configFile) throws Exception {
Properties properties = new Properties();
properties.load(new FileInputStream(configFile));
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/InfosCommand.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/InfosCommand.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/InfosCommand.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/InfosCommand.java Sun Apr 24 11:34:48 2011
@@ -28,7 +28,7 @@ public class InfosCommand implements Com
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.opencmis.commander.Command#getCommandName()
*/
public String getCommandName() {
@@ -37,7 +37,7 @@ public class InfosCommand implements Com
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.opencmis.commander.Command#getUsage()
*/
public String getUsage() {
@@ -52,7 +52,7 @@ public class InfosCommand implements Com
}
}
- private void printRepositoryInfo(RepositoryInfo repositoryInfo, PrintWriter output) {
+ private static void printRepositoryInfo(RepositoryInfo repositoryInfo, PrintWriter output) {
output.println("Id: " + repositoryInfo.getId());
output.println("Name: " + repositoryInfo.getProductName());
output.println("Description: " + repositoryInfo.getDescription());
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/ListCommand.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/ListCommand.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/ListCommand.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/ListCommand.java Sun Apr 24 11:34:48 2011
@@ -30,7 +30,7 @@ public class ListCommand implements Comm
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.opencmis.commander.Command#getCommandName()
*/
public String getCommandName() {
@@ -39,7 +39,7 @@ public class ListCommand implements Comm
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.opencmis.commander.Command#getUsage()
*/
public String getUsage() {
@@ -68,7 +68,7 @@ public class ListCommand implements Comm
/**
* Returns a property value as string.
*/
- private String getPropertyValue(ObjectInFolderData object, String name) {
+ private static String getPropertyValue(ObjectInFolderData object, String name) {
if ((object == null) || (object.getObject() == null) || (object.getObject().getProperties() == null)
|| (object.getObject().getProperties().getProperties() == null)) {
return "?";
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjGenApp.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjGenApp.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjGenApp.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjGenApp.java Sun Apr 24 11:34:48 2011
@@ -456,11 +456,11 @@ public class ObjGenApp {
return binding;
}
- private String getAtomPubUrl() {
+ private static String getAtomPubUrl() {
return System.getProperty(PROP_ATOMPUB_URL, DEFAULT_ATOMPUB_URL);
}
- private String getWsUrl() {
+ private static String getWsUrl() {
return System.getProperty(PROP_WS_URL, DEFAULT_WS_URL);
}
@@ -468,7 +468,7 @@ public class ObjGenApp {
return System.getProperty(PROP_URL, fUrlStr);
}
- private void getUrl(String urlStr) {
+ private static void getUrl(String urlStr) {
URL url;
InputStream is;
InputStreamReader isr;
Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java Sun Apr 24 11:34:48 2011
@@ -55,6 +55,9 @@ public class ClientHelper {
private static final Log log = LogFactory.getLog(ClientHelper.class);
private static final int BUFFER_SIZE = 64 * 1024;
+
+ private ClientHelper() {
+ }
public static void showError(Component parent, Exception ex) {
if (log.isErrorEnabled()) {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/ActionPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/ActionPanel.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/ActionPanel.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/ActionPanel.java Sun Apr 24 11:34:48 2011
@@ -105,7 +105,8 @@ public abstract class ActionPanel extend
centerPanel.add(comp);
}
- public void actionPerformed(ActionEvent e) {
+ @Override
+ public void actionPerformed(ActionEvent e) {
try {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
doAction();
@@ -133,7 +134,8 @@ public abstract class ActionPanel extend
JButton browseButton = new JButton("Browse");
browseButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
+ @Override
+ public void actionPerformed(ActionEvent event) {
JFileChooser fileChooser = new JFileChooser();
int chooseResult = fileChooser.showDialog(filenameField,
"Select");
Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java Sun Apr 24 11:34:48 2011
@@ -57,20 +57,18 @@ public class CollectionRenderer extends
// build string
StringBuilder sb = new StringBuilder("<html>");
- if (col != null) {
- for (Object o : col) {
- sb.append("<span>"); // workaround for a bug in Swing
- if (o == null) {
- sb.append("<i>null</i>");
- } else if (o instanceof GregorianCalendar) {
- sb.append(ClientHelper.getDateString((GregorianCalendar) o));
- } else if (o instanceof Choice<?>) {
- sb.append(((Choice<?>) o).getValue());
- } else {
- sb.append(o.toString());
- }
- sb.append("</span><br/>");
+ for (Object o : col) {
+ sb.append("<span>"); // workaround for a bug in Swing
+ if (o == null) {
+ sb.append("<i>null</i>");
+ } else if (o instanceof GregorianCalendar) {
+ sb.append(ClientHelper.getDateString((GregorianCalendar) o));
+ } else if (o instanceof Choice<?>) {
+ sb.append(((Choice<?>) o).getValue());
+ } else {
+ sb.append(o.toString());
}
+ sb.append("</span><br/>");
}
sb.append("</html>");
Modified: chemistry/opencmis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/pom.xml?rev=1096313&r1=1096312&r2=1096313&view=diff
==============================================================================
--- chemistry/opencmis/trunk/pom.xml (original)
+++ chemistry/opencmis/trunk/pom.xml Sun Apr 24 11:34:48 2011
@@ -154,6 +154,20 @@
<role>release manager</role>
</roles>
</developer>
+ <developer>
+ <name>Florent Guillaume</name>
+ <id>fguillaume</id>
+ <roles>
+ <role>committer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Stefane Fermigier</name>
+ <id>sfermigier</id>
+ <roles>
+ <role>committer</role>
+ </roles>
+ </developer>
</developers>