From derby-commits-return-15285-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Mon Feb 27 10:13:50 2012 Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-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 D456F993F for ; Mon, 27 Feb 2012 10:13:50 +0000 (UTC) Received: (qmail 76936 invoked by uid 500); 27 Feb 2012 10:13:50 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 76878 invoked by uid 500); 27 Feb 2012 10:13:50 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 76866 invoked by uid 99); 27 Feb 2012 10:13:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 10:13:50 +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, 27 Feb 2012 10:13:48 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 23B1A23888CD; Mon, 27 Feb 2012 10:13:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1294088 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit: SecurityManagerSetup.java TestConfiguration.java Date: Mon, 27 Feb 2012 10:13:29 -0000 To: derby-commits@db.apache.org From: kristwaa@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120227101329.23B1A23888CD@eris.apache.org> Author: kristwaa Date: Mon Feb 27 10:13:28 2012 New Revision: 1294088 URL: http://svn.apache.org/viewvc?rev=1294088&view=rev Log: DERBY-5631: Extend SecurityManagerSetup to add extra privileges to the set of default privileges (merge two policy files) Introduced constant NO_POLICY for "". Corrected class name in license. Fixed typo. Patch file: derby-5631-2a-introduce_NO_POLICY_constant.diff Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java?rev=1294088&r1=1294087&r2=1294088&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java Mon Feb 27 10:13:28 2012 @@ -1,6 +1,6 @@ /* * - * Derby - Class org.apache.derbyTesting.functionTests.util.SecurityManagerSetup + * Derby - Class org.apache.derbyTesting.junit.SecurityManagerSetup * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -38,6 +38,9 @@ import junit.framework.TestSuite; */ public final class SecurityManagerSetup extends TestSetup { + /** Constant used to indicate that no security policy is to be installed. */ + static final String NO_POLICY = ""; + /** * Does the JVM support Subjects for * authorization through Java security manager. @@ -114,7 +117,7 @@ public final class SecurityManagerSetup if (externalSecurityManagerInstalled) return new TestSuite("skipped due to external security manager " + test.toString()); - return new SecurityManagerSetup(test, ""); + return new SecurityManagerSetup(test, NO_POLICY); } /** @@ -123,11 +126,11 @@ public final class SecurityManagerSetup */ static void noSecurityManager() { - installSecurityManager(""); + installSecurityManager(NO_POLICY); } /** - * Install specific polciy file with the security manager + * Install specific policy file with the security manager * including the special case of no security manager. */ protected void setUp() { @@ -136,7 +139,7 @@ public final class SecurityManagerSetup protected void tearDown() throws Exception { - if ("".equals(decoratorPolicyResource)) + if (NO_POLICY.equals(decoratorPolicyResource)) BaseTestCase.setSystemProperty("java.security.policy", ""); else if ( !externalSecurityManagerInstalled ) { @@ -202,7 +205,7 @@ public final class SecurityManagerSetup } // Check indicator for no security manager - if ("".equals(set.getProperty("java.security.policy"))) + if (NO_POLICY.equals(set.getProperty("java.security.policy"))) return; // and install @@ -224,7 +227,7 @@ public final class SecurityManagerSetup private static void setSecurityPolicy(Properties set, String policyResource) { - if ("".equals(policyResource)) { + if (NO_POLICY.equals(policyResource)) { set.setProperty("java.security.policy", policyResource); return; } Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java?rev=1294088&r1=1294087&r2=1294088&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java Mon Feb 27 10:13:28 2012 @@ -2012,7 +2012,7 @@ public final class TestConfiguration { SecurityManagerSetup.noSecurityManager(); return false; } else { - if ("".equals( + if (SecurityManagerSetup.NO_POLICY.equals( BaseTestCase.getSystemProperty("java.security.policy"))) { // Explict setting of no security manager