aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2012-11-29 09:07:12 (EST)
committerJohn Ross2012-11-29 09:07:12 (EST)
commitfe7b257f1e7a8a6e4501acb7d48e70a3fbfc444a (patch)
treebcf24188f535bbb6a82d537a27ecae49bfd53e7a
parentf2af8d39c36d377c1774d648c21a00f7c2fdb49c (diff)
downloadrt.equinox.bundles-fe7b257f1e7a8a6e4501acb7d48e70a3fbfc444a.zip
rt.equinox.bundles-fe7b257f1e7a8a6e4501acb7d48e70a3fbfc444a.tar.gz
rt.equinox.bundles-fe7b257f1e7a8a6e4501acb7d48e70a3fbfc444a.tar.bz2
[Bug 395334] Add test for matching against the bundle-symbolic-name attribute.
-rw-r--r--bundles/org.eclipse.equinox.region.tests/src/org/eclipse/equinox/internal/region/Bug395334Test.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.region.tests/src/org/eclipse/equinox/internal/region/Bug395334Test.java b/bundles/org.eclipse.equinox.region.tests/src/org/eclipse/equinox/internal/region/Bug395334Test.java
new file mode 100644
index 0000000..a8ebb19
--- /dev/null
+++ b/bundles/org.eclipse.equinox.region.tests/src/org/eclipse/equinox/internal/region/Bug395334Test.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.region;
+
+import org.eclipse.equinox.region.RegionFilter;
+import org.eclipse.equinox.region.RegionFilterBuilder;
+import org.eclipse.equinox.region.tests.system.AbstractRegionSystemTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.wiring.BundleRevision;
+
+/**
+ * The StandardRegionFilter.isAllowed(BundleRevision) method must match against
+ * the bundle-symbolic-name attribute as per the RegionFilter API.
+ */
+public class Bug395334Test extends AbstractRegionSystemTest {
+ public void testBug395334() throws Exception {
+ RegionFilterBuilder filterBuilder = digraph.createRegionFilterBuilder();
+ filterBuilder.allow(RegionFilter.VISIBLE_BUNDLE_NAMESPACE, "(bundle-symbolic-name=org.eclipse.osgi)");
+ RegionFilter filter = filterBuilder.build();
+ Bundle systemBundle = getContext().getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
+ assertTrue("The bundle revision should be allowed by the filter", filter.isAllowed(systemBundle.adapt(BundleRevision.class)));
+ }
+}