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 E77C917D15 for ; Mon, 6 Oct 2014 19:25:36 +0000 (UTC) Received: (qmail 26610 invoked by uid 500); 6 Oct 2014 19:25:36 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 26565 invoked by uid 500); 6 Oct 2014 19:25:36 -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 26554 invoked by uid 99); 6 Oct 2014 19:25:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2014 19:25:36 +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; Mon, 06 Oct 2014 19:25:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7BF8C2388980; Mon, 6 Oct 2014 19:25:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1629741 - /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java Date: Mon, 06 Oct 2014 19:25:12 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141006192512.7BF8C2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmui Date: Mon Oct 6 19:25:12 2014 New Revision: 1629741 URL: http://svn.apache.org/r1629741 Log: TCK: extended property definition test Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java?rev=1629741&r1=1629740&r2=1629741&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java Mon Oct 6 19:25:12 2014 @@ -75,7 +75,10 @@ import org.apache.chemistry.opencmis.com import org.apache.chemistry.opencmis.commons.data.RepositoryCapabilities; import org.apache.chemistry.opencmis.commons.data.RepositoryInfo; import org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition; +import org.apache.chemistry.opencmis.commons.definitions.PropertyDecimalDefinition; import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition; +import org.apache.chemistry.opencmis.commons.definitions.PropertyIntegerDefinition; +import org.apache.chemistry.opencmis.commons.definitions.PropertyStringDefinition; import org.apache.chemistry.opencmis.commons.definitions.RelationshipTypeDefinition; import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition; import org.apache.chemistry.opencmis.commons.enums.Action; @@ -3447,6 +3450,45 @@ public abstract class AbstractSessionTes addResult(results, f); } } + + // data type specific tests + if (propDef instanceof PropertyStringDefinition) { + PropertyStringDefinition stringPropDef = (PropertyStringDefinition) propDef; + + if (stringPropDef.getMaxLength() != null) { + if (stringPropDef.getMaxLength().signum() == 0) { + f = createResult(WARNING, "Max length is 0!"); + addResult(results, f); + } else if (stringPropDef.getMaxLength().signum() == -1) { + f = createResult(FAILURE, "Max length is negative!"); + addResult(results, f); + } + } + } else if (propDef instanceof PropertyIntegerDefinition) { + PropertyIntegerDefinition intPropDef = (PropertyIntegerDefinition) propDef; + + if (intPropDef.getMinValue() != null & intPropDef.getMaxValue() != null) { + if (intPropDef.getMinValue().compareTo(intPropDef.getMaxValue()) == 0) { + f = createResult(WARNING, "Min and max values are equal!"); + addResult(results, f); + } else if (intPropDef.getMinValue().compareTo(intPropDef.getMaxValue()) == 1) { + f = createResult(FAILURE, "Min value is greater than max value!"); + addResult(results, f); + } + } + } else if (propDef instanceof PropertyDecimalDefinition) { + PropertyDecimalDefinition decPropDef = (PropertyDecimalDefinition) propDef; + + if (decPropDef.getMinValue() != null & decPropDef.getMaxValue() != null) { + if (decPropDef.getMinValue().compareTo(decPropDef.getMaxValue()) == 0) { + f = createResult(WARNING, "Min and max values are equal!"); + addResult(results, f); + } else if (decPropDef.getMinValue().compareTo(decPropDef.getMaxValue()) == 1) { + f = createResult(FAILURE, "Min value is greater than max value!"); + addResult(results, f); + } + } + } } }