felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
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 GMT
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



Mime
View raw message