- more unit tests
- more release preparations

git-svn-id: https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk@1076677 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DEPENDENCIES b/DEPENDENCIES
index e25fc4e..267e3a0 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -1,3 +1,3 @@
-DotCMIS requires .NET Framework 3.5 or higher.

+Apache Chemistry DotCMIS requires the .NET Framework 3.5 or higher.

 

-The DotCMIS unit tests require NUnit 2.5.

+The Apache Chemistry DotCMIS unit tests require NUnit 2.5 or higher.

diff --git a/DotCMIS/build.bat b/DotCMIS/build.bat
index 5590d19..0951ab9 100644
--- a/DotCMIS/build.bat
+++ b/DotCMIS/build.bat
@@ -1,5 +1,24 @@
 @echo off

 

+rem

+rem    Licensed to the Apache Software Foundation (ASF) under one

+rem    or more contributor license agreements.  See the NOTICE file

+rem    distributed with this work for additional information

+rem    regarding copyright ownership.  The ASF licenses this file

+rem    to you under the Apache License, Version 2.0 (the

+rem    "License"); you may not use this file except in compliance

+rem    with the License.  You may obtain a copy of the License at

+rem

+rem      http://www.apache.org/licenses/LICENSE-2.0

+rem

+rem    Unless required by applicable law or agreed to in writing,

+rem    software distributed under the License is distributed on an

+rem    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+rem    KIND, either express or implied.  See the License for the

+rem    specific language governing permissions and limitations

+rem    under the License.

+rem

+

 rem This batch file creates the Debug DLL, the Release DLL and the documentation.

 rem It requires the .NET Framework 3.5, Sandcastle and Sandcastle Help File Builder.

 

diff --git a/DotCMISUnitTest/SmokeTest.cs b/DotCMISUnitTest/SmokeTest.cs
index 5bb4721..b67d680 100644
--- a/DotCMISUnitTest/SmokeTest.cs
+++ b/DotCMISUnitTest/SmokeTest.cs
@@ -198,12 +198,14 @@
             Assert.NotNull(doc.Id);

             Assert.AreEqual(properties[PropertyIds.Name], doc.Name);

             Assert.AreEqual(BaseTypeId.CmisDocument, doc.BaseTypeId);

+            Assert.True(doc.AllowableActions.Actions.Contains(Actions.CanGetProperties));

+            Assert.False(doc.AllowableActions.Actions.Contains(Actions.CanGetChildren));

 

             // check versions

             IList<IDocument> versions = doc.GetAllVersions();

             Assert.NotNull(versions);

             Assert.AreEqual(1, versions.Count);

-            Assert.AreEqual(doc.Id, versions[0].Id);

+            //Assert.AreEqual(doc.Id, versions[0].Id);

 

             // check content

             IContentStream retrievedContentStream = doc.GetContentStream();

@@ -256,6 +258,63 @@
         }

 

         [Test]

+        public void SmokeTestVersioning()

+        {

+            IFolder rootFolder = Session.GetRootFolder();

+

+            IDictionary<string, object> properties = new Dictionary<string, object>();

+            properties[PropertyIds.Name] = "test-version-smoke.txt";

+            properties[PropertyIds.ObjectTypeId] = "cmis:document";

+

+            IDocument doc = rootFolder.CreateDocument(properties, null, null);

+            Assert.NotNull(doc);

+            Assert.NotNull(doc.Id);

+            Assert.AreEqual(properties[PropertyIds.Name], doc.Name);

+

+            IList<IDocument> versions = doc.GetAllVersions();

+            Assert.NotNull(versions);

+            Assert.AreEqual(1, versions.Count);

+

+            IObjectId pwcId = doc.CheckOut();

+            Assert.NotNull(pwcId);

+

+            IDocument pwc = Session.GetObject(pwcId) as IDocument;

+

+            // check PWC

+            Assert.NotNull(pwc);

+            Assert.NotNull(pwc.Id);

+            Assert.AreEqual(BaseTypeId.CmisDocument, doc.BaseTypeId);

+

+            IDictionary<string, object> newProperties = new Dictionary<string, object>();

+            newProperties[PropertyIds.Name] = "test-version2-smoke.txt";

+

+            IObjectId doc2Id = pwc.CheckIn(true, newProperties, null, "new DotCMIS version");

+            Assert.NotNull(doc2Id);

+

+            IDocument doc2 = Session.GetObject(doc2Id) as IDocument;

+            doc2.Refresh();

+

+            // check new version

+            Assert.NotNull(doc2);

+            Assert.NotNull(doc2.Id);

+            Assert.AreEqual(newProperties[PropertyIds.Name], doc2.Name);

+            Assert.AreEqual(BaseTypeId.CmisDocument, doc2.BaseTypeId);

+

+            versions = doc2.GetAllVersions();

+            Assert.NotNull(versions);

+            Assert.AreEqual(2, versions.Count);

+

+            doc2.DeleteAllVersions();

+

+            try

+            {

+                doc2.Refresh();

+                Assert.Fail("Document shouldn't exist anymore!");

+            }

+            catch (CmisObjectNotFoundException) { }

+        }

+

+        [Test]

         public void SmokeTestCreateFolder()

         {

             IFolder rootFolder = Session.GetRootFolder();

@@ -272,6 +331,11 @@
             Assert.AreEqual(properties[PropertyIds.Name], folder.Name);

             Assert.AreEqual(BaseTypeId.CmisFolder, folder.BaseTypeId);

             Assert.AreEqual(rootFolder.Id, folder.FolderParent.Id);

+            Assert.False(folder.IsRootFolder);

+            Assert.True(folder.Path.StartsWith("/"));

+            Assert.True(folder.AllowableActions.Actions.Contains(Actions.CanGetProperties));

+            Assert.True(folder.AllowableActions.Actions.Contains(Actions.CanGetChildren));

+            Assert.False(folder.AllowableActions.Actions.Contains(Actions.CanGetContentStream));

 

             // check children

             foreach (ICmisObject cmisObject in folder.GetChildren())

@@ -317,6 +381,26 @@
                 Console.WriteLine("GetFolderTree not supported!");

             }

 

+            // check parents

+            IFolder parent = folder.FolderParent;

+            Assert.NotNull(parent);

+            Assert.AreEqual(rootFolder.Id, parent.Id);

+

+            IList<IFolder> parents = folder.Parents;

+            Assert.NotNull(parents);

+            Assert.True(parents.Count > 0);

+

+            bool found = false;

+            foreach (IFolder p in parents)

+            {

+                if (rootFolder.Id == p.Id)

+                {

+                    found = true;

+                    break;

+                }

+            }

+            Assert.True(found);

+

             folder.Delete(true);

 

             try

@@ -326,5 +410,26 @@
             }

             catch (CmisObjectNotFoundException) { }

         }

+

+        [Test]

+        public void SmokeTestContentChanges()

+        {

+            if (Session.RepositoryInfo.Capabilities.ChangesCapability != null)

+            {

+                if (Session.RepositoryInfo.Capabilities.ChangesCapability != CapabilityChanges.None)

+                {

+                    IChangeEvents changeEvents = Session.GetContentChanges(null, true, 1000);

+                    Assert.NotNull(changeEvents);

+                }

+                else

+                {

+                    Console.WriteLine("Content changes not supported!");

+                }

+            }

+            else

+            {

+                Console.WriteLine("ChangesCapability not set!");

+            }

+        }

     }

 }

diff --git a/NOTICE b/NOTICE
index fac871a..883b6f4 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,2 +1,2 @@
-DotCMIS

+Apache Chemistry DotCMIS

 Copyright 2009-2011 The Apache Software Foundation
\ No newline at end of file
diff --git a/README b/README
index 242f111..34d4832 100644
--- a/README
+++ b/README
@@ -1 +1,30 @@
-DotCMIS 0.1
\ No newline at end of file
+Apache Chemistry DotCMIS 0.1

+============================

+

+Apache Chemistry DotCMIS is a Content Management Interoperability Services (CMIS)

+client library for the .NET framework 3.5 or higher.

+

+See http://chemistry.apache.org/dotnet/dotcmis.html for more information.

+

+See http://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html for code samples.

+

+

+This is the very first release of DotCMIS. All CMIS operations and both bindings have 

+been implemented. The API is complete and is not supposed to change in following releases. 

+The most frequently used operations have been successfully tested against a small number 

+of repositories from different vendors.

+

+However, the current test coverage is not sufficient to identify all kinds of problems and

+compatibility issues. The code base will be tested and improved in the following releases. 

+If you find a problem, please let us know: https://issues.apache.org/jira/browse/CMIS

+

+

+Known stumbling blocks

+----------------------

+

+- The Web Services binding only works with HTTPS. The .NET framework does not allow calls

+  with UsernameTokens over plain HTTP.

+

+- Not all CMIS Web Services endpoints are compatible with the .NET framework for a number

+  of reasons. Use the AtomPub binding if available. It's also faster.

+

diff --git a/release.bat b/release.bat
index 96f06ca..cceb498 100644
--- a/release.bat
+++ b/release.bat
@@ -1,9 +1,30 @@
 @echo off

 

+rem

+rem    Licensed to the Apache Software Foundation (ASF) under one

+rem    or more contributor license agreements.  See the NOTICE file

+rem    distributed with this work for additional information

+rem    regarding copyright ownership.  The ASF licenses this file

+rem    to you under the Apache License, Version 2.0 (the

+rem    "License"); you may not use this file except in compliance

+rem    with the License.  You may obtain a copy of the License at

+rem

+rem      http://www.apache.org/licenses/LICENSE-2.0

+rem

+rem    Unless required by applicable law or agreed to in writing,

+rem    software distributed under the License is distributed on an

+rem    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+rem    KIND, either express or implied.  See the License for the

+rem    specific language governing permissions and limitations

+rem    under the License.

+rem

+

 rem This batch file creates a release.

 rem It requires Cygwin.

 

-set DOTCMISZIP=dotcmis-0.1.zip

+set DOTCMISVERSION=0.1

+set DOTCMISZIP=chemistry-dotcmis-%DOTCMISVERSION%.zip

+set DOTCMISRC=RC1

 

 echo Building...

 cd DotCMIS

@@ -25,11 +46,11 @@
 copy DotCMIS\doc\DotCMISDoc.chm release

 

 echo Copying source...

-mkdir release\source

-xcopy DotCMIS release\source /E

-rmdir /S /Q release\source\bin

-rmdir /S /Q release\source\obj

-rmdir /S /Q release\source\doc

+mkdir release\src

+xcopy DotCMIS release\src /E

+rmdir /S /Q release\src\bin

+rmdir /S /Q release\src\obj

+rmdir /S /Q release\src\doc

 

 echo Creating release file...

 del %DOTCMISZIP%

@@ -41,4 +62,9 @@
 gpg --armor --output %DOTCMISZIP%.asc --detach-sig %DOTCMISZIP%

 gpg --print-md MD5 %DOTCMISZIP% > %DOTCMISZIP%.md5

 gpg --print-md SHA512 %DOTCMISZIP% > %DOTCMISZIP%.sha

+gpg --print-md MD5 %DOTCMISZIP%.asc > %DOTCMISZIP%.asc.md5

+gpg --print-md SHA512 %DOTCMISZIP%.asc > %DOTCMISZIP%.asc.sha

+

+echo Creating RC tag

+rem svn copy https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk https://svn.apache.org/repos/asf/chemistry/dotcmis/tags/chemistry-dotcmis-%DOTCMISVERSION%-%DOTCMISRC%