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 E3EBF9D29 for ; Tue, 3 Apr 2012 05:29:23 +0000 (UTC) Received: (qmail 71553 invoked by uid 500); 3 Apr 2012 05:29:23 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 71501 invoked by uid 500); 3 Apr 2012 05:29:23 -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 71470 invoked by uid 99); 3 Apr 2012 05:29:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2012 05:29:22 +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, 03 Apr 2012 05:28:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5DE592388C8A for ; Tue, 3 Apr 2012 05:28:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r811241 [13/15] - in /websites/staging/chemistry/trunk/content: ./ java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/ java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/css/ java/0.7.0/maven/chemistry-op... Date: Tue, 03 Apr 2012 05:28:23 -0000 To: commits@chemistry.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120403052828.5DE592388C8A@eris.apache.org> Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/MultifilingTest.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/MultifilingTest.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/MultifilingTest.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,151 @@ + + + + +MultifilingTest xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.tck.tests.filing;
+20  
+21  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
+22  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.SKIPPED;
+23  
+24  import java.util.Map;
+25  
+26  import org.apache.chemistry.opencmis.client.api.Document;
+27  import org.apache.chemistry.opencmis.client.api.Folder;
+28  import org.apache.chemistry.opencmis.client.api.Session;
+29  import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+30  import org.apache.chemistry.opencmis.tck.CmisTestResult;
+31  import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
+32  
+33  /**
+34   * Multifiling test.
+35   */
+36  public class MultifilingTest extends AbstractSessionTest {
+37  
+38      @Override
+39      public void init(Map<String, String> parameters) {
+40          super.init(parameters);
+41          setName("Multifiling Test");
+42          setDescription("Creates two folders and a document in one of the folders, "
+43                  + "adds the document to the second folder and then removes it again for the second folder.");
+44      }
+45  
+46      @Override
+47      public void run(Session session) {
+48          if (supportsMultifiling(session)) {
+49              CmisTestResult f;
+50  
+51              int count1;
+52              int count2;
+53              int parents;
+54  
+55              try {
+56                  // create folders
+57                  Folder testFolder = createTestFolder(session);
+58                  Folder folder1 = createFolder(session, testFolder, "folder1");
+59                  Folder folder2 = createFolder(session, testFolder, "folder2");
+60  
+61                  // create document
+62                  Document doc1 = createDocument(session, folder1, "testdoc.txt", "multifiling test");
+63  
+64                  addResult(checkChildren(session, folder1, "Folder 1 after createDocument()"));
+65                  addResult(checkChildren(session, folder2, "Folder 2 after createDocument()"));
+66  
+67                  count1 = countFolderChildren(folder1);
+68                  f = createResult(FAILURE, "Folder 1 should have exactly one child but has " + count1 + " children!");
+69                  addResult(assertEquals(1, count1, null, f));
+70  
+71                  count2 = countFolderChildren(folder2);
+72                  f = createResult(FAILURE, "Folder 2 should not have children but has " + count2 + " children!");
+73                  addResult(assertEquals(0, count2, null, f));
+74  
+75                  parents = doc1.getParents().size();
+76                  f = createResult(FAILURE, "Document should have one parent but has " + parents + " parents!");
+77                  addResult(assertEquals(1, parents, null, f));
+78  
+79                  // add to other folder
+80                  doc1.addToFolder(folder2, true);
+81  
+82                  addResult(checkChildren(session, folder1, "Folder 1 after addToFolder()"));
+83                  addResult(checkChildren(session, folder2, "Folder 2 after addToFolder()"));
+84  
+85                  count1 = countFolderChildren(folder1);
+86                  f = createResult(FAILURE, "Folder 1 should have exactly one child but has " + count1 + " children!");
+87                  addResult(assertEquals(1, count1, null, f));
+88  
+89                  count2 = countFolderChildren(folder2);
+90                  f = createResult(FAILURE, "Folder 2 should have exactly one child but has " + count2 + " children!");
+91                  addResult(assertEquals(1, count2, null, f));
+92  
+93                  parents = doc1.getParents().size();
+94                  f = createResult(FAILURE, "Document should have two parents but has " + parents + " parents!");
+95                  addResult(assertEquals(2, parents, null, f));
+96  
+97                  // remove from first folder
+98                  doc1.removeFromFolder(folder2);
+99  
+100                 addResult(checkChildren(session, folder1, "Folder 1 after removeFromFolder()"));
+101                 addResult(checkChildren(session, folder2, "Folder 2 after removeFromFolder()"));
+102 
+103                 count1 = countFolderChildren(folder1);
+104                 f = createResult(FAILURE, "Folder 1 should have exactly one child but has " + count1 + " children!");
+105                 addResult(assertEquals(1, count1, null, f));
+106 
+107                 count2 = countFolderChildren(folder2);
+108                 f = createResult(FAILURE, "Folder 2 should not have children but has " + count2 + " children!");
+109                 addResult(assertEquals(0, count2, null, f));
+110 
+111                 parents = doc1.getParents().size();
+112                 f = createResult(FAILURE, "Document should have one parent but has " + parents + " parents!");
+113                 addResult(assertEquals(1, parents, null, f));
+114 
+115                 // delete everything
+116                 deleteObject(doc1);
+117                 deleteObject(folder2);
+118                 deleteObject(folder1);
+119             } finally {
+120                 // clean up
+121                 deleteTestFolder();
+122             }
+123         } else {
+124             addResult(createResult(SKIPPED, "Multifling not supported. Test Skipped!"));
+125         }
+126     }
+127 
+128     protected boolean supportsMultifiling(Session session) {
+129         RepositoryInfo repository = session.getRepositoryInfo();
+130 
+131         if (repository.getCapabilities().isMultifilingSupported() == null) {
+132             return false;
+133         }
+134 
+135         return repository.getCapabilities().isMultifilingSupported().booleanValue();
+136     }
+137 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/UnfilingTest.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/UnfilingTest.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/UnfilingTest.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,132 @@ + + + + +UnfilingTest xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.tck.tests.filing;
+20  
+21  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
+22  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.SKIPPED;
+23  
+24  import java.util.Map;
+25  
+26  import org.apache.chemistry.opencmis.client.api.Document;
+27  import org.apache.chemistry.opencmis.client.api.Folder;
+28  import org.apache.chemistry.opencmis.client.api.Session;
+29  import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+30  import org.apache.chemistry.opencmis.tck.CmisTestResult;
+31  import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
+32  
+33  /**
+34   * Unfiling test.
+35   */
+36  public class UnfilingTest extends AbstractSessionTest {
+37  
+38      @Override
+39      public void init(Map<String, String> parameters) {
+40          super.init(parameters);
+41          setName("Unfiling Test");
+42          setDescription("Creates a folder and a document, removes the document from the folder and then adds it again.");
+43      }
+44  
+45      @Override
+46      public void run(Session session) {
+47          if (supportsUnfiling(session)) {
+48              CmisTestResult f;
+49  
+50              int count;
+51              int parents;
+52  
+53              try {
+54                  // create folders
+55                  Folder testFolder = createTestFolder(session);
+56                  Folder folder1 = createFolder(session, testFolder, "folder1");
+57  
+58                  // create document
+59                  Document doc1 = createDocument(session, folder1, "testdoc.txt", "unfiling test");
+60  
+61                  addResult(checkChildren(session, folder1, "Folder after createDocument()"));
+62  
+63                  count = countFolderChildren(folder1);
+64                  f = createResult(FAILURE, "Folder should have exactly one child but has " + count + " children!");
+65                  addResult(assertEquals(1, count, null, f));
+66  
+67                  parents = doc1.getParents().size();
+68                  f = createResult(FAILURE, "Document should have one parent but has " + parents + " parents!");
+69                  addResult(assertEquals(1, parents, null, f));
+70  
+71                  // remove from folder
+72                  doc1.removeFromFolder(folder1);
+73  
+74                  addResult(checkChildren(session, folder1, "Folder after removeFromFolder()"));
+75  
+76                  count = countFolderChildren(folder1);
+77                  f = createResult(FAILURE, "Folder should have no children but has " + count + " children!");
+78                  addResult(assertEquals(0, count, null, f));
+79  
+80                  parents = doc1.getParents().size();
+81                  f = createResult(FAILURE, "Document should not have no parents but has " + parents + " parents!");
+82                  addResult(assertEquals(0, parents, null, f));
+83  
+84                  // add to folder again
+85                  doc1.addToFolder(folder1, true);
+86  
+87                  addResult(checkChildren(session, folder1, "Folder after addToFolder()"));
+88  
+89                  count = countFolderChildren(folder1);
+90                  f = createResult(FAILURE, "Folder should have exactly one child but has " + count + " children!");
+91                  addResult(assertEquals(1, count, null, f));
+92  
+93                  parents = doc1.getParents().size();
+94                  f = createResult(FAILURE, "Document should have one parent but has " + parents + " parents!");
+95                  addResult(assertEquals(1, parents, null, f));
+96  
+97                  // delete everything
+98                  deleteObject(doc1);
+99                  deleteObject(folder1);
+100             } finally {
+101                 // clean up
+102                 deleteTestFolder();
+103             }
+104         } else {
+105             addResult(createResult(SKIPPED, "Unfiling not supported. Test Skipped!"));
+106         }
+107     }
+108 
+109     protected boolean supportsUnfiling(Session session) {
+110         RepositoryInfo repository = session.getRepositoryInfo();
+111 
+112         if (repository.getCapabilities().isUnfilingSupported() == null) {
+113             return false;
+114         }
+115 
+116         return repository.getCapabilities().isUnfilingSupported().booleanValue();
+117     }
+118 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/package-frame.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/package-frame.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/package-frame.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,30 @@ + + + + + + OpenCMIS Test Compatibility Kit 0.7.0 Reference Package org.apache.chemistry.opencmis.tck.tests.filing + + + + +

+ org.apache.chemistry.opencmis.tck.tests.filing +

+ +

Classes

+ + + + + \ No newline at end of file Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/package-summary.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/package-summary.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/filing/package-summary.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,77 @@ + + + + + + OpenCMIS Test Compatibility Kit 0.7.0 Reference Package org.apache.chemistry.opencmis.tck.tests.filing + + + +
+ +
+
+ +
+ +

Package org.apache.chemistry.opencmis.tck.tests.filing

+ + + + + + + + + + + + + + + + + + +
Class Summary
+ FilingTestGroup +
+ MultifilingTest +
+ UnfilingTest +
+ +
+ +
+
+ +
+
+ Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved. + + \ No newline at end of file Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/AbstractQueryTest.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/AbstractQueryTest.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/AbstractQueryTest.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,51 @@ + + + + +AbstractQueryTest xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.tck.tests.query;
+20  
+21  import org.apache.chemistry.opencmis.client.api.Session;
+22  import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+23  import org.apache.chemistry.opencmis.commons.enums.CapabilityQuery;
+24  import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
+25  
+26  public abstract class AbstractQueryTest extends AbstractSessionTest {
+27  
+28      protected boolean supportsQuery(Session session) {
+29          RepositoryInfo repository = session.getRepositoryInfo();
+30  
+31          if (repository.getCapabilities().getQueryCapability() == null) {
+32              return false;
+33          }
+34  
+35          return repository.getCapabilities().getQueryCapability() != CapabilityQuery.NONE;
+36      }
+37  }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/ContentChangesSmokeTest.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/ContentChangesSmokeTest.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/ContentChangesSmokeTest.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,127 @@ + + + + +ContentChangesSmokeTest xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.tck.tests.query;
+20  
+21  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
+22  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.SKIPPED;
+23  
+24  import java.util.Map;
+25  
+26  import org.apache.chemistry.opencmis.client.api.ChangeEvent;
+27  import org.apache.chemistry.opencmis.client.api.ChangeEvents;
+28  import org.apache.chemistry.opencmis.client.api.CmisObject;
+29  import org.apache.chemistry.opencmis.client.api.Session;
+30  import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+31  import org.apache.chemistry.opencmis.commons.enums.BindingType;
+32  import org.apache.chemistry.opencmis.commons.enums.CapabilityChanges;
+33  import org.apache.chemistry.opencmis.commons.enums.ChangeType;
+34  import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
+35  import org.apache.chemistry.opencmis.tck.CmisTestResult;
+36  import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
+37  
+38  /**
+39   * Content Changes smoke test.
+40   */
+41  public class ContentChangesSmokeTest extends AbstractSessionTest {
+42  
+43      @Override
+44      public void init(Map<String, String> parameters) {
+45          super.init(parameters);
+46          setName("Content Changes Smoke Test");
+47          setDescription("Calls getContentChanges(). It does not check if the results are correct!");
+48      }
+49  
+50      @Override
+51      public void run(Session session) {
+52          CmisTestResult f;
+53  
+54          if (supportsContentChanges(session)) {
+55              ChangeEvents events = session.getContentChanges(null, true, 1000, SELECT_ALL_NO_CACHE_OC);
+56  
+57              f = createResult(FAILURE, "Change events are null!");
+58              addResult(assertNotNull(events, null, f));
+59  
+60              if (events != null && events.getChangeEvents() != null) {
+61  
+62                  if (getBinding() != BindingType.ATOMPUB) {
+63                      // the AtompPub binding does not return a change log token
+64                      f = createResult(FAILURE, "Change log token is null!");
+65                      addResult(assertNotNull(events.getLatestChangeLogToken(), null, f));
+66                  }
+67  
+68                  for (ChangeEvent event : events.getChangeEvents()) {
+69                      f = createResult(FAILURE, "Object Id is not set!");
+70                      addResult(assertStringNotEmpty(event.getObjectId(), null, f));
+71  
+72                      f = createResult(FAILURE, "Change Type is not set! Id: " + event.getObjectId());
+73                      addResult(assertNotNull(event.getChangeType(), null, f));
+74  
+75                      f = createResult(FAILURE, "Change Time is not set! Id: " + event.getObjectId());
+76                      addResult(assertNotNull(event.getChangeTime(), null, f));
+77  
+78                      if (event.getObjectId() != null) {
+79                          if (event.getChangeType() == ChangeType.DELETED) {
+80                              try {
+81                                  session.getObject(event.getObjectId(), SELECT_ALL_NO_CACHE_OC);
+82                                  addResult(createResult(FAILURE,
+83                                          "Change event indicates that an object has been deleted but it still exists. Id: "
+84                                                  + event.getObjectId()));
+85                              } catch (CmisObjectNotFoundException e) {
+86                              }
+87                          } else {
+88                              try {
+89                                  CmisObject object = session.getObject(event.getObjectId(), SELECT_ALL_NO_CACHE_OC);
+90                                  addResult(checkObject(session, object, getAllProperties(object), "Object check. Id: "
+91                                          + event.getObjectId()));
+92                              } catch (CmisObjectNotFoundException e) {
+93                                  // object might have been deleted later
+94                              }
+95                          }
+96                      }
+97                  }
+98              }
+99          } else {
+100             addResult(createResult(SKIPPED, "Content Changes not supported. Test Skipped!"));
+101         }
+102     }
+103 
+104     protected boolean supportsContentChanges(Session session) {
+105         RepositoryInfo repository = session.getRepositoryInfo();
+106 
+107         if (repository.getCapabilities().getChangesCapability() == null) {
+108             return false;
+109         }
+110 
+111         return repository.getCapabilities().getChangesCapability() != CapabilityChanges.NONE;
+112     }
+113 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/QueryLikeTest.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/QueryLikeTest.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/QueryLikeTest.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,106 @@ + + + + +QueryLikeTest xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.tck.tests.query;
+20  
+21  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
+22  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.SKIPPED;
+23  
+24  import java.util.Map;
+25  
+26  import org.apache.chemistry.opencmis.client.api.CmisObject;
+27  import org.apache.chemistry.opencmis.client.api.OperationContext;
+28  import org.apache.chemistry.opencmis.client.api.Session;
+29  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+30  import org.apache.chemistry.opencmis.tck.CmisTestResult;
+31  
+32  public class QueryLikeTest extends AbstractQueryTest {
+33  
+34      @Override
+35      public void init(Map<String, String> parameters) {
+36          super.init(parameters);
+37          setName("Query LIKE Test");
+38          setDescription("Performs a query that should return the root folder name and id.");
+39      }
+40  
+41      @Override
+42      public void run(Session session) {
+43          if (supportsQuery(session)) {
+44  
+45              OperationContext context = session.createOperationContext();
+46              context.setFilterString("cmis:name,cmis:creationDate");
+47              context.setCacheEnabled(false);
+48              context.setIncludeAcls(false);
+49              context.setIncludeAllowableActions(false);
+50              context.setIncludePathSegments(false);
+51              context.setIncludePolicies(false);
+52              context.setIncludeRelationships(IncludeRelationships.NONE);
+53              context.setRenditionFilterString("cmis:none");
+54              context.setOrderBy("cmis:creationDate");
+55  
+56              CmisTestResult f;
+57  
+58              for (char c = 'a'; c <= 'z'; c++) {
+59                  long timestamp = Long.MIN_VALUE;
+60  
+61                  for (CmisObject o : session
+62                          .queryObjects("cmis:document", "cmis:name LIKE '" + c + "%'", false, context).getPage(10)) {
+63  
+64                      if (o.getName() == null) {
+65                          addResult(createResult(
+66                                  FAILURE,
+67                                  "Documents without name should not be returned by this query! Document id: "
+68                                          + o.getId()));
+69                      } else {
+70                          f = createResult(FAILURE,
+71                                  "Document name should start with '" + c + "' but the name is '" + o.getName() + "'");
+72                          addResult(assertIsTrue(o.getName().startsWith("" + c), null, f));
+73                      }
+74  
+75                      if (o.getCreationDate() == null) {
+76                          addResult(createResult(FAILURE,
+77                                  "Found document without creation date! Document id: " + o.getId()));
+78                      } else {
+79                          f = createResult(FAILURE,
+80                                  "Query results should be ordered by cmis:creationDate but they are not!");
+81                          addResult(assertIsTrue(timestamp <= o.getCreationDate().getTimeInMillis(), null, f));
+82  
+83                          timestamp = o.getCreationDate().getTimeInMillis();
+84                      }
+85                  }
+86              }
+87  
+88          } else {
+89              addResult(createResult(SKIPPED, "Query not supported. Test Skipped!"));
+90          }
+91      }
+92  }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/QueryRootFolderTest.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/QueryRootFolderTest.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-tck/xref/org/apache/chemistry/opencmis/tck/tests/query/QueryRootFolderTest.html Tue Apr 3 05:28:19 2012 @@ -0,0 +1,150 @@ + + + + +QueryRootFolderTest xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.tck.tests.query;
+20  
+21  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
+22  import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.SKIPPED;
+23  
+24  import java.util.GregorianCalendar;
+25  import java.util.Map;
+26  
+27  import org.apache.chemistry.opencmis.client.api.Folder;
+28  import org.apache.chemistry.opencmis.client.api.QueryResult;
+29  import org.apache.chemistry.opencmis.client.api.QueryStatement;
+30  import org.apache.chemistry.opencmis.client.api.Session;
+31  import org.apache.chemistry.opencmis.commons.PropertyIds;
+32  import org.apache.chemistry.opencmis.tck.CmisTestResult;
+33  
+34  /**
+35   * Root folder query test.
+36   */
+37  public class QueryRootFolderTest extends AbstractQueryTest {
+38  
+39      @Override
+40      public void init(Map<String, String> parameters) {
+41          super.init(parameters);
+42          setName("Query Root Folder Test");
+43          setDescription("Performs a query that should return the root folder name and id.");
+44      }
+45  
+46      @Override
+47      public void run(Session session) {
+48          if (supportsQuery(session)) {
+49              queryById(session);
+50              queryByDate(session);
+51          } else {
+52              addResult(createResult(SKIPPED, "Query not supported. Test Skipped!"));
+53          }
+54      }
+55  
+56      protected void queryById(Session session) {
+57          CmisTestResult f;
+58  
+59          String testType = "cmis:folder";
+60  
+61          Folder rootFolder = session.getRootFolder();
+62  
+63          QueryStatement statement = session
+64                  .createQueryStatement("SELECT ? AS folderName, ? AS folderId FROM ? WHERE ? = ?");
+65  
+66          statement.setProperty(1, testType, PropertyIds.NAME);
+67          statement.setProperty(2, testType, PropertyIds.OBJECT_ID);
+68          statement.setType(3, testType);
+69          statement.setProperty(4, testType, PropertyIds.OBJECT_ID);
+70          statement.setString(5, rootFolder.getId());
+71  
+72          addResult(createInfoResult("Query: " + statement.toQueryString()));
+73  
+74          int count = 0;
+75          for (QueryResult qr : statement.query(false)) {
+76              count++;
+77  
+78              String folderName = qr.getPropertyValueByQueryName("folderName");
+79              String folderId = qr.getPropertyValueByQueryName("folderId");
+80  
+81              f = createResult(FAILURE, "Query result does not match root folder name!");
+82              addResult(assertEquals(rootFolder.getName(), folderName, null, f));
+83  
+84              f = createResult(FAILURE, "Query result does not match root folder id!");
+85              addResult(assertEquals(rootFolder.getId(), folderId, null, f));
+86          }
+87  
+88          f = createResult(FAILURE, "The query should return exactly one result but returned " + count + "!");
+89          addResult(assertEquals(1, count, null, f));
+90      }
+91  
+92      protected void queryByDate(Session session) {
+93          CmisTestResult f;
+94  
+95          String testType = "cmis:folder";
+96  
+97          Folder rootFolder = session.getRootFolder();
+98  
+99          GregorianCalendar before = new GregorianCalendar();
+100         before.setTimeInMillis(rootFolder.getCreationDate().getTimeInMillis() - (60 * 60 * 1000));
+101 
+102         GregorianCalendar after = new GregorianCalendar();
+103         after.setTimeInMillis(rootFolder.getCreationDate().getTimeInMillis() + (60 * 60 * 1000));
+104 
+105         QueryStatement statement = session
+106                 .createQueryStatement("SELECT ? AS folderName, ? AS folderId FROM ? WHERE ? > TIMESTAMP ? AND ? < TIMESTAMP ?");
+107 
+108         statement.setProperty(1, testType, PropertyIds.NAME);
+109         statement.setProperty(2, testType, PropertyIds.OBJECT_ID);
+110         statement.setType(3, testType);
+111         statement.setProperty(4, testType, PropertyIds.CREATION_DATE);
+112         statement.setDateTime(5, before);
+113         statement.setProperty(6, testType, PropertyIds.CREATION_DATE);
+114         statement.setDateTime(7, after);
+115 
+116         addResult(createInfoResult("Query: " + statement.toQueryString()));
+117 
+118         boolean found = false;
+119         for (QueryResult qr : statement.query(false)) {
+120             String folderId = qr.getPropertyValueByQueryName("folderId");
+121 
+122             if (rootFolder.getId().equals(folderId)) {
+123                 found = true;
+124 
+125                 String folderName = qr.getPropertyValueByQueryName("folderName");
+126 
+127                 f = createResult(FAILURE, "Query result does not match root folder name!");
+128                 addResult(assertEquals(rootFolder.getName(), folderName, null, f));
+129                 break;
+130             }
+131         }
+132 
+133         f = createResult(FAILURE, "The query should return the root folder but does not!");
+134         addResult(assertIsTrue(found, null, f));
+135     }
+136 }
+
+
+ +