chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1720097 - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-api/src/test/java/org/apache/chemistry/opencmis/client/ chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry...
Date Tue, 15 Dec 2015 09:23:08 GMT
Author: fmui
Date: Tue Dec 15 09:23:08 2015
New Revision: 1720097

URL: http://svn.apache.org/viewvc?rev=1720097&view=rev
Log:
code clean up

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/test/java/org/apache/chemistry/opencmis/client/SessionParameterMapTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryFinderTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.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-client/chemistry-opencmis-client-api/src/test/java/org/apache/chemistry/opencmis/client/SessionParameterMapTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/test/java/org/apache/chemistry/opencmis/client/SessionParameterMapTest.java?rev=1720097&r1=1720096&r2=1720097&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/test/java/org/apache/chemistry/opencmis/client/SessionParameterMapTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/test/java/org/apache/chemistry/opencmis/client/SessionParameterMapTest.java
Tue Dec 15 09:23:08 2015
@@ -192,26 +192,32 @@ public class SessionParameterMapTest {
 
         private static final long serialVersionUID = 1L;
 
+        @Override
         public Map<String, List<String>> getHTTPHeaders(String url) {
             return null;
         }
 
+        @Override
         public Element getSOAPHeaders(Object portObject) {
             return null;
         }
 
+        @Override
         public HandlerResolver getHandlerResolver() {
             return null;
         }
 
+        @Override
         public SSLSocketFactory getSSLSocketFactory() {
             return null;
         }
 
+        @Override
         public HostnameVerifier getHostnameVerifier() {
             return null;
         }
 
+        @Override
         public void putResponseHeaders(String url, int statusCode, Map<String, List<String>>
headers) {
         }
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java?rev=1720097&r1=1720096&r2=1720097&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
Tue Dec 15 09:23:08 2015
@@ -700,6 +700,7 @@ public abstract class AbstractCmisObject
         return result;
     }
 
+    @Deprecated
     @Override
     public Set<String> getPermissonsForPrincipal(String principalId) {
         return getPermissionsForPrincipal(principalId);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryFinderTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryFinderTest.java?rev=1720097&r1=1720096&r2=1720097&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryFinderTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryFinderTest.java
Tue Dec 15 09:23:08 2015
@@ -85,10 +85,12 @@ public class SessionFactoryFinderTest {
             return null;
         }
 
+        @Override
         public Session createSession(Map<String, String> parameters) {
             return null;
         }
 
+        @Override
         public List<Repository> getRepositories(Map<String, String> parameters)
{
             return null;
         }
@@ -96,6 +98,8 @@ public class SessionFactoryFinderTest {
 
     public static class MockSessionFactory2 extends SessionFactoryImpl {
 
+        private static final long serialVersionUID = 1L;
+
         private MockSessionFactory2() {
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java?rev=1720097&r1=1720096&r2=1720097&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
Tue Dec 15 09:23:08 2015
@@ -24,10 +24,8 @@ import static org.junit.Assert.assertTru
 
 import java.io.ByteArrayOutputStream;
 import java.io.StringWriter;
-import java.lang.reflect.Array;
 import java.math.BigInteger;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.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/ObjectCreator.java?rev=1720097&r1=1720096&r2=1720097&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.java
Tue Dec 15 09:23:08 2015
@@ -28,8 +28,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import junit.framework.Assert;
-
 import org.apache.chemistry.opencmis.commons.PropertyIds;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
@@ -42,6 +40,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.spi.BindingsObjectFactory;
 import org.apache.chemistry.opencmis.commons.spi.Holder;
 import org.apache.chemistry.opencmis.commons.spi.ObjectService;
+import org.junit.Assert;
 
 public class ObjectCreator {
 
@@ -183,7 +182,7 @@ public class ObjectCreator {
         properties.add(fFactory.createPropertyStringData(propertyId, propertyValue));
         return properties;
     }
-    
+
     public boolean verifyProperty(String id, String propertyId, String propertyValue) {
         Properties props = fObjSvc.getProperties(fRepositoryId, id, "*", null);
         Map<String, PropertyData<?>> propsMap = props.getProperties();

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=1720097&r1=1720096&r2=1720097&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
Tue Dec 15 09:23:08 2015
@@ -91,7 +91,6 @@ import org.apache.chemistry.opencmis.ser
 import org.apache.chemistry.opencmis.util.repository.ObjectGenerator;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -140,7 +139,7 @@ public class ObjectServiceTest extends A
     public static final String TEST_RESTRICTED_RELATION_TYPE_ID = "RestrictedRelationType";
     public static final String TEST_POLICY_TYPE_ID = "AuditPolicy";
     public static final String TEST_POLICY_PROPERTY_ID = "AuditSettings";
-	private static final String ENCODING_UTF8 = "UTF-8";
+    private static final String ENCODING_UTF8 = "UTF-8";
 
     ObjectCreator fCreator;
 
@@ -1145,7 +1144,7 @@ public class ObjectServiceTest extends A
     @Test
     public void testGetPartialContent() throws IOException, UnsupportedEncodingException
{
         log.info("starting testGetPartialContent() ...");
-        final String STREAM_NAME  = "data.txt";
+        final String STREAM_NAME = "data.txt";
         final String MIME_TYPE = "text/plain";
         // append content again in a second call
 
@@ -1154,17 +1153,17 @@ public class ObjectServiceTest extends A
         content.setMimeType(MIME_TYPE);
 
         String prefix = "################ ~~~~This is a completeley irrelevant prefix header.
~~~~ ################";
-		String main = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.
Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit.
Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam
tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula
ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut
gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor
nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt
feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros.
Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus
et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris
vitae nisi at sem facilisis semper ac in est.";
+        String main = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur
ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet
vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero
sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor.
Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit
pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan.
Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan
ultricies. Mauris vitae nisi at sem facilisis semper ac in est.";
         String postfix = "################ ~~~~POSTFIX Please ignore POSTFIX POSTFIX POSTFIX
~~~~ ################";
 
         ByteArrayOutputStream ba = new ByteArrayOutputStream();
-        PrintStream printStream = new PrintStream(ba, false, ENCODING_UTF8); 
+        PrintStream printStream = new PrintStream(ba, false, ENCODING_UTF8);
         printStream.println(prefix);
         printStream.println(main);
         printStream.println(postfix);
 
         content.setContent(new ByteArrayInputStream(ba.toByteArray()));
-        
+
         // Create document with content
         Properties props = createDocumentProperties("PartialContentTest", BaseTypeId.CMIS_DOCUMENT.value());
         String id = fObjSvc.createDocument(fRepositoryId, props, fRootFolderId, content,
VersioningState.NONE, null,
@@ -1172,12 +1171,13 @@ public class ObjectServiceTest extends A
         if (id != null) {
             log.info("createDocument succeeded with created id: " + id);
         }
-        
-        int offset = prefix.length() + System.getProperty("line.separator").length(); //
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);
-		
+        ContentStream readContent = fObjSvc.getContentStream(fRepositoryId, id, null, BigInteger.valueOf(offset),
+                BigInteger.valueOf(length), null);
+
         assertEquals(MIME_TYPE, readContent.getMimeType());
         assertEquals(STREAM_NAME, readContent.getFileName());
         assertEquals(length, readContent.getBigLength().longValue());
@@ -1188,7 +1188,7 @@ public class ObjectServiceTest extends A
         String result = new String(bytesRead, 0, lengthRead, ENCODING_UTF8);
         assertEquals(length, lengthRead);
         assertEquals(main, result);
-        
+
         // cleanup
         fObjSvc.deleteObject(fRepositoryId, id, true, null);
 



Mime
View raw message