Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.felix</groupId>
<artifactId>dependencymanager-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>org.apache.felix.dependencymanager.index.itest.refresh.bundle</artifactId>
<packaging>bundle</packaging>

<name>Apache Felix Dependency Manager FilterIndex refresh test bundle</name>
<description>Internal test bundle used by the Apache Felix Dependency Manager FilterIndex refresh tests</description>

<properties>
<!-- the integration tests are not released -->
<baseline.skip>true</baseline.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>8.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.dependencymanager</artifactId>
<version>5.0.1-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-Category>test</Bundle-Category>
<Private-Package>org.apache.felix.dm.index.itest.refresh.bundle</Private-Package>
<Export-Package />
<Bundle-Activator>org.apache.felix.dm.index.itest.refresh.bundle.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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.index.itest.refresh.bundle;

import org.apache.felix.dm.DependencyActivatorBase;
import org.apache.felix.dm.DependencyManager;
import org.osgi.framework.BundleContext;

/**
* Creates a component with a service dependency on the Runnable services having the
* "dm.refresh.test" property. The dependency filter only uses objectClass and this property, so it
* goes through the "objectClass,dm.refresh.test" index configured in the test.bndrun of the refresh
* tests (with the "org.apache.felix.dependencymanager.filterindex" property).
*
* The service type comes from the JDK, so that the test bundle doesn't need to import any package
* of this bundle (which is refreshed with the DependencyManager bundle). The property is needed
* because other bundles register Runnable services (the bnd tester registers itself as a Runnable,
* to run the tests).
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class Activator extends DependencyActivatorBase {

@Override
public void init(BundleContext context, DependencyManager dm) throws Exception {
dm.add(createComponent()
.setImplementation(RunnableConsumer.class)
.add(createServiceDependency()
.setService(Runnable.class, "(dm.refresh.test=true)")
.setRequired(false)
.setCallbacks("add", "change", null)));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.index.itest.refresh.bundle;

/**
* Runs each Runnable service injected by the DependencyManager, and each time the properties of
* such a service are updated: this is how the test sees that the dependency works, and that the
* service events are propagated.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class RunnableConsumer {

void add(Runnable runnable) {
runnable.run();
}

void change(Runnable runnable) {
runnable.run();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.felix</groupId>
<artifactId>dependencymanager-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>org.apache.felix.dependencymanager.index.itest.refresh.tests</artifactId>
<packaging>bundle</packaging>

<name>Apache Felix Dependency Manager FilterIndex refresh tests</name>
<description>Integration tests for the filter indices of Apache Felix Dependency Manager, when the DependencyManager bundle is refreshed</description>

<properties>
<!-- the integration tests are not released -->
<baseline.skip>true</baseline.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<!--
This test bundle must not import any package of the DependencyManager bundle (or of the refresh
test bundle): it would be refreshed (stopped and restarted) with it, in the middle of the test.
So these bundles are only runtime dependencies.
-->
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>8.0.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.dependencymanager</artifactId>
<version>5.0.1-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.dependencymanager.index.itest.refresh.bundle</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
<version>${configadmin.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.log</artifactId>
<version>${log.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.metatype</artifactId>
<version>${metatype.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>${framework.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.junit</artifactId>
<version>${servicemix.junit.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-Category>test</Bundle-Category>
<Private-Package>org.apache.felix.dm.index.itest.refresh.tests</Private-Package>
<Export-Package />
<Test-Cases>$[classes;CONCRETE;EXTENDS;junit.framework.TestCase]</Test-Cases>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-testing-maven-plugin</artifactId>
<configuration>
<bundles>
<bundle>${project.build.directory}/${project.build.finalName}.jar</bundle>
</bundles>
<bndruns>
<bndrun>test.bndrun</bndrun>
</bndruns>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading
Loading