Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 596EC10FA0 for ; Tue, 9 Jul 2013 21:15:44 +0000 (UTC) Received: (qmail 98502 invoked by uid 500); 9 Jul 2013 21:15:44 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 98446 invoked by uid 500); 9 Jul 2013 21:15:43 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 98438 invoked by uid 99); 9 Jul 2013 21:15:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jul 2013 21:15:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jul 2013 21:15:42 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 01A4723888CD; Tue, 9 Jul 2013 21:15:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1501552 - in /chemistry/opencmis/branches/inmemory-refactoring/src: main/java/org/apache/chemistry/opencmis/inmemory/server/ main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ test/java/org/apache/chemistry/opencmis/inmemory/... Date: Tue, 09 Jul 2013 21:15:21 -0000 To: commits@chemistry.apache.org From: jens@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130709211522.01A4723888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jens Date: Tue Jul 9 21:15:21 2013 New Revision: 1501552 URL: http://svn.apache.org/r1501552 Log: Fix a few bugs with version label [CMIS-687], [CMIS-688], [CMIS-689] Modified: chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java Modified: chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java?rev=1501552&r1=1501551&r2=1501552&view=diff ============================================================================== --- chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java (original) +++ chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java Tue Jul 9 21:15:21 2013 @@ -95,6 +95,9 @@ public class InMemoryVersioningServiceIm if (contentStream != null && contentStream.getStream() == null) contentStream = null; + if (null == major) + major = true; + verDoc.checkIn(major, properties, contentStream, checkinComment, policies, user); // To be able to provide all Atom links in the response we need Modified: chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java?rev=1501552&r1=1501551&r2=1501552&view=diff ============================================================================== --- chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java (original) +++ chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java Tue Jul 9 21:15:21 2013 @@ -52,7 +52,6 @@ public class DocumentVersionImpl extends private String fComment; // checkin comment boolean fIsMajor; boolean fIsPwc; // true if this is the PWC - String label; public DocumentVersionImpl(String repositoryId, VersionedDocument container, ContentStream content, VersioningState verState, ObjectStoreImpl objStore) { @@ -70,8 +69,6 @@ public class DocumentVersionImpl extends fProperties.put(prop.getKey(), prop.getValue()); } } - - label = createVersionLabel(); } @Override @@ -119,7 +116,7 @@ public class DocumentVersionImpl extends } private String createVersionLabel() { - int majorNo = 1; + int majorNo = 0; int minorNo = 0; List allVersions = fContainer.getAllVersions(); for (DocumentVersion ver : allVersions) { @@ -133,7 +130,7 @@ public class DocumentVersionImpl extends break; } } - String label = "V " + majorNo + "." + minorNo; + String label = majorNo + "." + minorNo; return label; } @@ -317,7 +314,7 @@ public class DocumentVersionImpl extends @Override public String getVersionLabel() { - return label; + return createVersionLabel(); } @Override Modified: chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java?rev=1501552&r1=1501551&r2=1501552&view=diff ============================================================================== --- chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java (original) +++ chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java Tue Jul 9 21:15:21 2013 @@ -903,13 +903,13 @@ public class EvalQueryTest extends Abstr assertEquals(2, res.getObjects().size()); assertTrue(resultContains("ver123", UnitTestTypeSystemCreator.VERSION_PROPERTY_ID, res)); assertTrue(resultContains("ver456", UnitTestTypeSystemCreator.VERSION_PROPERTY_ID, res)); - assertTrue(resultContains("V 1.0", PropertyIds.VERSION_LABEL, res)); - assertTrue(resultContains("V 2.0", PropertyIds.VERSION_LABEL, res)); + assertTrue(resultContains("1.0", PropertyIds.VERSION_LABEL, res)); + assertTrue(resultContains("2.0", PropertyIds.VERSION_LABEL, res)); res = doQuery(statement); assertEquals(1, res.getObjects().size()); - assertFalse(resultContains("V 1.0", PropertyIds.VERSION_LABEL, res)); - assertTrue(resultContains("V 2.0", PropertyIds.VERSION_LABEL, res)); + assertFalse(resultContains("1.0", PropertyIds.VERSION_LABEL, res)); + assertTrue(resultContains("2.0", PropertyIds.VERSION_LABEL, res)); log.debug("...Stop testLastestVersionsWithQuery."); } @@ -922,12 +922,12 @@ public class EvalQueryTest extends Abstr ObjectList res = doQuery(statement); assertEquals(1, res.getObjects().size()); assertTrue(resultContains("ver456", UnitTestTypeSystemCreator.VERSION_PROPERTY_ID, res)); - assertTrue(resultContains("V 2.0", PropertyIds.VERSION_LABEL, res)); + assertTrue(resultContains("2.0", PropertyIds.VERSION_LABEL, res)); res = doQuery(statement); assertEquals(1, res.getObjects().size()); - assertFalse(resultContains("V 1.0", PropertyIds.VERSION_LABEL, res)); - assertTrue(resultContains("V 2.0", PropertyIds.VERSION_LABEL, res)); + assertFalse(resultContains("1.0", PropertyIds.VERSION_LABEL, res)); + assertTrue(resultContains("2.0", PropertyIds.VERSION_LABEL, res)); log.debug("...Stop testLastestVersionsWithQuery."); }