chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1644986 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ test/java/org/apache/chemistry/opencmis/inmemory/
Date Fri, 12 Dec 2014 17:37:31 GMT
Author: jens
Date: Fri Dec 12 17:37:30 2014
New Revision: 1644986

URL: http://svn.apache.org/r1644986
Log:
InMemory: second try to fix test failures with Java8 under Windows

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java?rev=1644986&r1=1644985&r2=1644986&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
Fri Dec 12 17:37:30 2014
@@ -142,7 +142,16 @@ public class StoredObjectImpl implements
 
     @Override
     public void setModifiedAtNow() {
-        this.fModifiedAt = getNow();
+    	GregorianCalendar now = getNow();
+    	// ensure a larger time for modification date and change token:
+    	while (now.getTimeInMillis() == fModifiedAt.getTimeInMillis()) {
+    		try {
+    			Thread.sleep(1);
+    		} catch (InterruptedException ex) {    			
+    		}
+    		now = getNow();
+    	}
+        this.fModifiedAt = now;
     }
 
     @Override

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java?rev=1644986&r1=1644985&r2=1644986&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
Fri Dec 12 17:37:30 2014
@@ -1173,7 +1173,7 @@ public class ObjectServiceTest extends A
             log.info("createDocument succeeded with created id: " + id);
         }
         
-        int offset = prefix.length() + 1; // +1 for \n
+        int offset = prefix.length() + System.getProperty("line.separator").length(); //
for \n
         int length = main.length();
 		ContentStream readContent = fObjSvc.getContentStream(fRepositoryId, id, null,
 				BigInteger.valueOf(offset), BigInteger.valueOf(length), null);



Mime
View raw message