You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pd...@apache.org on 2010/02/24 23:50:06 UTC
svn commit: r916026 -
/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java
Author: pderop
Date: Wed Feb 24 22:50:06 2010
New Revision: 916026
URL: http://svn.apache.org/viewvc?rev=916026&view=rev
Log:
added integration test for BundleDependency annotation
Added:
felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java
Added: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java?rev=916026&view=auto
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java (added)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java Wed Feb 24 22:50:06 2010
@@ -0,0 +1,73 @@
+/*
+* 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.dm.test.annotation;
+
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.provision;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.felix.dm.DependencyManager;
+import org.apache.felix.dm.test.BundleGenerator;
+import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+/**
+ * Use case: Verify Bundle Dependency annotations usage.
+ */
+@RunWith(JUnit4TestRunner.class)
+public class BundleDependencyAnnotationTest extends AnnotationBase
+{
+ @Configuration
+ public static Option[] configuration()
+ {
+ return options(
+ provision(
+ mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version("4.1.0"),
+ mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject(),
+ mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager.runtime").versionAsInProject()),
+ provision(
+ new BundleGenerator()
+ .set(Constants.BUNDLE_SYMBOLICNAME, "BundleDependencyTest")
+ .set("Export-Package", "org.apache.felix.dm.test.bundle.annotation.sequencer")
+ .set("Private-Package", "org.apache.felix.dm.test.bundle.annotation.bundledependency")
+ .set("Import-Package", "*")
+ .set("-plugin", "org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin")
+ .build()));
+ }
+
+ @Test
+ public void testBundleDependencyAnnotation(BundleContext context)
+ {
+ DependencyManager m = new DependencyManager(context);
+ m.add(m.createService().setImplementation(this).setInterface(Sequencer.class.getName(), null));
+ m_ensure.waitForStep(1, 10000);
+ super.stopBundle("BundleDependencyTest", context);
+ m_ensure.waitForStep(2, 10000);
+ }
+
+}