Return-Path: Delivered-To: apmail-incubator-chemistry-commits-archive@minotaur.apache.org Received: (qmail 78153 invoked from network); 26 Feb 2010 17:36:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Feb 2010 17:36:01 -0000 Received: (qmail 3722 invoked by uid 500); 26 Feb 2010 17:36:00 -0000 Delivered-To: apmail-incubator-chemistry-commits-archive@incubator.apache.org Received: (qmail 3684 invoked by uid 500); 26 Feb 2010 17:36:00 -0000 Mailing-List: contact chemistry-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chemistry-dev@incubator.apache.org Delivered-To: mailing list chemistry-commits@incubator.apache.org Received: (qmail 3651 invoked by uid 99); 26 Feb 2010 17:36:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2010 17:36:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Fri, 26 Feb 2010 17:35:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 20E93238890B; Fri, 26 Feb 2010 17:35:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r916768 - in /incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec: RepositoryServiceTest.java TypeDefinitionTest.java Date: Fri, 26 Feb 2010 17:35:37 -0000 To: chemistry-commits@incubator.apache.org From: dcaruana@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100226173537.20E93238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dcaruana Date: Fri Feb 26 17:35:36 2010 New Revision: 916768 URL: http://svn.apache.org/viewvc?rev=916768&view=rev Log: Fix CMIS-132: TCK: Test that the URI template has all variables as stated in the spec - added tests for each of the four URI templates - query uri template only tested if query capability supported Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/TypeDefinitionTest.java Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java?rev=916768&r1=916767&r2=916768&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java (original) +++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java Fri Feb 26 17:35:36 2010 @@ -19,6 +19,9 @@ import org.apache.abdera.i18n.iri.IRI; import org.apache.abdera.model.Service; +import org.apache.chemistry.abdera.ext.CMISCapabilities; +import org.apache.chemistry.abdera.ext.CMISUriTemplate; +import org.apache.chemistry.tck.atompub.TCKSkipCapabilityException; import org.apache.chemistry.tck.atompub.TCKTest; import org.apache.chemistry.tck.atompub.http.GetRequest; import org.junit.Assert; @@ -39,4 +42,51 @@ client.executeRequest(new GetRequest(rootHREF.toString()), 200); } + public void testObjectByIdURITemplate() throws Exception { + CMISUriTemplate uriTemplate = client.getObjectByIdUriTemplate(client.getWorkspace()); + assertNotNull(uriTemplate); + String template = uriTemplate.getTemplate(); + assertNotNull(template); + assertTemplateVariables(template, new String[] { "id", "filter", "includeAllowableActions", + "includePolicyIds", "includeRelationships", "includeACL", "renditionFilter" }); + } + + public void testObjectByPathURITemplate() throws Exception { + CMISUriTemplate uriTemplate = client.getObjectByPathUriTemplate(client.getWorkspace()); + assertNotNull(uriTemplate); + String template = uriTemplate.getTemplate(); + assertNotNull(template); + assertTemplateVariables(template, new String[] { "path", "filter", "includeAllowableActions", + "includePolicyIds", "includeRelationships", "includeACL", "renditionFilter" }); + } + + public void testTypeByIdURITemplate() throws Exception { + CMISUriTemplate uriTemplate = client.getTypeByIdUriTemplate(client.getWorkspace()); + assertNotNull(uriTemplate); + String template = uriTemplate.getTemplate(); + assertNotNull(template); + assertTemplateVariables(template, new String[] { "id" }); + } + + public void testQueryURITemplate() throws Exception { + CMISCapabilities capabilities = client.getCapabilities(); + String capability = capabilities.getQuery(); + assertNotNull(capability); + if (capability.equals("none")) + throw new TCKSkipCapabilityException("query", "metadataonly or fulltextonly or bothseparate or bothcombined", capability); + + CMISUriTemplate uriTemplate = client.getQueryUriTemplate(client.getWorkspace()); + assertNotNull(uriTemplate); + String template = uriTemplate.getTemplate(); + assertNotNull(template); + assertTemplateVariables(template, new String[] { "q", "searchAllVersions", "maxItems", "skipCount", + "includeAllowableActions", "includeRelationships"}); + } + + private void assertTemplateVariables(String template, String[] variables) { + for (String variable : variables) + { + assertTrue("template " + template + " contains variable " + variable, template.contains("{" + variable + "}")); + } + } } Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/TypeDefinitionTest.java URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/TypeDefinitionTest.java?rev=916768&r1=916767&r2=916768&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/TypeDefinitionTest.java (original) +++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/TypeDefinitionTest.java Fri Feb 26 17:35:36 2010 @@ -94,4 +94,6 @@ // TODO: test correct type for entry & properties of type } } + + // TODO: test for getTypeById uri template }