Return-Path: X-Original-To: apmail-jackrabbit-commits-archive@www.apache.org Delivered-To: apmail-jackrabbit-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 B6C48DEE2 for ; Wed, 12 Dec 2012 10:02:55 +0000 (UTC) Received: (qmail 18208 invoked by uid 500); 12 Dec 2012 10:02:55 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 18031 invoked by uid 500); 12 Dec 2012 10:02:52 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 17991 invoked by uid 99); 12 Dec 2012 10:02:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 10:02:51 +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; Wed, 12 Dec 2012 10:02:50 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D5EA02388906; Wed, 12 Dec 2012 10:02:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1420601 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java Date: Wed, 12 Dec 2012 10:02:29 -0000 To: commits@jackrabbit.apache.org From: mreutegg@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121212100229.D5EA02388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mreutegg Date: Wed Dec 12 10:02:27 2012 New Revision: 1420601 URL: http://svn.apache.org/viewvc?rev=1420601&view=rev Log: JCR-3482: SetValueVersionExceptionTest makes assumption about implementation Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java?rev=1420601&r1=1420600&r2=1420601&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java (original) +++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java Wed Dec 12 10:02:27 2012 @@ -50,8 +50,10 @@ public class SetValueVersionExceptionTes private Property property; private Property multiProperty; - private Value value; - private Value values[]; + private Value initialValue; + private Value[] initialValues; + private Value modifiedValue; + private Value[] modifiedValues; /** * Sets up the fixture for the test cases. @@ -60,8 +62,10 @@ public class SetValueVersionExceptionTes super.setUp(); session = getHelper().getReadOnlySession(); - value = session.getValueFactory().createValue("abc"); - values = new Value[] {value}; + initialValue = session.getValueFactory().createValue("abc"); + modifiedValue = session.getValueFactory().createValue("def"); + initialValues = new Value[] {initialValue}; + modifiedValues = new Value[] {initialValue, modifiedValue}; if (!isSupported(Repository.OPTION_VERSIONING_SUPPORTED)) { throw new NotExecutableException("Versioning is not supported."); @@ -72,8 +76,8 @@ public class SetValueVersionExceptionTes // or try to make it versionable if it is not ensureMixinType(node, mixVersionable); - property = node.setProperty(propertyName1, value); - multiProperty = node.setProperty(propertyName2, values); + property = node.setProperty(propertyName1, initialValue); + multiProperty = node.setProperty(propertyName2, initialValues); testRootNode.getSession().save(); @@ -85,6 +89,7 @@ public class SetValueVersionExceptionTes */ protected void tearDown() throws Exception { try { + superuser.refresh(false); node.checkout(); } finally { if (session != null) { @@ -94,8 +99,10 @@ public class SetValueVersionExceptionTes node = null; property = null; multiProperty = null; - value = null; - values = null; + initialValue = null; + initialValues = null; + modifiedValue = null; + modifiedValues = null; super.tearDown(); } } @@ -106,7 +113,7 @@ public class SetValueVersionExceptionTes */ public void testValue() throws RepositoryException { try { - property.setValue(value); + property.setValue(modifiedValue); node.save(); fail("Property.setValue(Value) must throw a VersionException " + "immediately or on save if the parent node of this property " + @@ -123,7 +130,7 @@ public class SetValueVersionExceptionTes */ public void testValueArray() throws RepositoryException { try { - multiProperty.setValue(values); + multiProperty.setValue(modifiedValues); node.save(); fail("Property.setValue(Value[]) must throw a VersionException " + "immediately or on save if the parent node of this property " + @@ -140,7 +147,7 @@ public class SetValueVersionExceptionTes */ public void testString() throws RepositoryException { try { - property.setValue("abc"); + property.setValue(modifiedValue.getString()); node.save(); fail("Property.setValue(String) must throw a VersionException " + "immediately or on save if the parent node of this property " + @@ -157,7 +164,7 @@ public class SetValueVersionExceptionTes */ public void testStringArray() throws RepositoryException { try { - String values[] = new String[] {"abc"}; + String values[] = new String[0]; multiProperty.setValue(values); node.save(); fail("Property.setValue(String[]) must throw a VersionException " + @@ -296,7 +303,7 @@ public class SetValueVersionExceptionTes node.checkin(); try { - property.setValue(referenceableNode); + property.setValue(node); node.save(); fail("Property.setValue(Node) must throw a VersionException " + "immediately or on save if the parent node of this property " + @@ -306,6 +313,7 @@ public class SetValueVersionExceptionTes // success } + superuser.refresh(false); node.checkout(); } }