chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1745123 - in /chemistry/portcmis/trunk: PortCMIS/client/ClientObjects.cs PortCMIS/data/DataImpl.cs PortCMISTests/SimpleCmisTest.cs
Date Mon, 23 May 2016 08:08:49 GMT
Author: fmui
Date: Mon May 23 08:08:49 2016
New Revision: 1745123

URL: http://svn.apache.org/viewvc?rev=1745123&view=rev
Log:
PortCMIS: final minor changes before release

Modified:
    chemistry/portcmis/trunk/PortCMIS/client/ClientObjects.cs
    chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs
    chemistry/portcmis/trunk/PortCMISTests/SimpleCmisTest.cs

Modified: chemistry/portcmis/trunk/PortCMIS/client/ClientObjects.cs
URL: http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/client/ClientObjects.cs?rev=1745123&r1=1745122&r2=1745123&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/client/ClientObjects.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/client/ClientObjects.cs Mon May 23 08:08:49 2016
@@ -992,7 +992,7 @@ namespace PortCMIS.Client.Impl
         /// <summary>
         /// Copies the document manually. The content is streamed from the repository and
back.
         /// </summary>
-        protected IObjectId CopyViaClient(IObjectId targetFolderId, IDictionary<string,
object> properties,
+        protected virtual IObjectId CopyViaClient(IObjectId targetFolderId, IDictionary<string,
object> properties,
                 VersioningState? versioningState, IList<IPolicy> policies, IList<IAce>
addAces, IList<IAce> removeAces)
         {
             IDictionary<string, object> newProperties = new Dictionary<string, object>();

Modified: chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs
URL: http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs?rev=1745123&r1=1745122&r2=1745123&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs Mon May 23 08:08:49 2016
@@ -1094,7 +1094,7 @@ namespace PortCMIS.Data
                     {
                         throw new ArgumentException("Property '" + Id + "' is a Decimal property!");
                     }
-                    return value;
+                    return (decimal)value;
                 case PropertyType.Uri:
                     if (!(value is string))
                     {

Modified: chemistry/portcmis/trunk/PortCMISTests/SimpleCmisTest.cs
URL: http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMISTests/SimpleCmisTest.cs?rev=1745123&r1=1745122&r2=1745123&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMISTests/SimpleCmisTest.cs (original)
+++ chemistry/portcmis/trunk/PortCMISTests/SimpleCmisTest.cs Mon May 23 08:08:49 2016
@@ -176,6 +176,46 @@ namespace PortCMISTests
         }
 
         [TestMethod]
+        public void TestCreateBig()
+        {
+            int docSize = 50 * 1024 * 1024; // 50MiB
+
+            // get root folder
+            IFolder root = Session.GetRootFolder();
+            IDocument doc = null;
+
+            try
+            {
+                // create document
+                StringBuilder sb = new StringBuilder(docSize);
+                for (int i = 0; i < docSize; i++)
+                {
+                    sb.Append('x');
+                }
+
+                string contentString = sb.ToString();
+
+                doc = CreateTextDocument(root, "big.txt", contentString);
+                Assert.IsNotNull(doc);
+
+                // get content
+                IContentStream newContent = doc.GetContentStream();
+                Assert.IsNotNull(newContent);
+                Assert.IsNotNull(newContent.Stream);
+
+                Assert.AreEqual(contentString, ConvertStreamToString(newContent.Stream));
+            }
+            finally
+            {
+                if (doc != null)
+                {
+                    doc.Delete();
+                    Assert.IsFalse(Session.Exists(doc));
+                }
+            }
+        }
+
+        [TestMethod]
         public void TestUpdateProperties()
         {
             string name1 = "port-test-folder1";



Mime
View raw message