Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 19987 invoked from network); 17 Mar 2009 18:38:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Mar 2009 18:38:03 -0000 Received: (qmail 30720 invoked by uid 500); 17 Mar 2009 18:38:02 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 30691 invoked by uid 500); 17 Mar 2009 18:38:02 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 30682 invoked by uid 99); 17 Mar 2009 18:38:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2009 11:38:02 -0700 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; Tue, 17 Mar 2009 18:38:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E9B892388970; Tue, 17 Mar 2009 18:37:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r755342 - /felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestMisc.java Date: Tue, 17 Mar 2009 18:37:41 -0000 To: commits@felix.apache.org From: rickhall@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090317183741.E9B892388970@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rickhall Date: Tue Mar 17 18:37:41 2009 New Revision: 755342 URL: http://svn.apache.org/viewvc?rev=755342&view=rev Log: Add a test for accessing the private data with an absolute path and an empty string. Added: felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestMisc.java Added: felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestMisc.java URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestMisc.java?rev=755342&view=auto ============================================================================== --- felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestMisc.java (added) +++ felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestMisc.java Tue Mar 17 18:37:41 2009 @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.framework.test; + +import java.io.InputStream; +import org.osgi.framework.Bundle; + +public class TestMisc extends FelixTestCase +{ + private Bundle m_bundleA = null; + private Bundle m_bundleB = null; + private Bundle m_bundleC = null; + + public void testDataFile() throws Exception + { + InputStream is = null; + + // Scenario + // + // Test that our private data area access with respect to + // absolute paths and getting its root. + + try + { + assertNull(getBundleContext().getDataFile("/")); + assertNotNull(getBundleContext().getDataFile("")); + } + finally + { + cleanup(); + } + } + + private void cleanup() + { + if (m_bundleA != null) + { + try + { + m_bundleA.uninstall(); + } + catch (Exception ex) + { + // Ummm? + } + m_bundleA = null; + } + if (m_bundleB != null) + { + try + { + m_bundleB.uninstall(); + } + catch (Exception ex) + { + // Ummm? + } + m_bundleB = null; + } + if (m_bundleC != null) + { + try + { + m_bundleC.uninstall(); + } + catch (Exception ex) + { + // Ummm? + } + m_bundleC = null; + } + refreshAndWait(); + } +} \ No newline at end of file