Skip to content

Commit 19a335c

Browse files
authored
Merge pull request #183 from rosette-api/RCB-603
RCB-603
2 parents 493c2e4 + fae3d88 commit 19a335c

File tree

6 files changed

+210
-0
lines changed

6 files changed

+210
-0
lines changed

api/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@
5656
<artifactId>httpclient</artifactId>
5757
<version>${http-components-version}</version>
5858
</dependency>
59+
<dependency>
60+
<groupId>org.apache.httpcomponents</groupId>
61+
<artifactId>httpclient-osgi</artifactId>
62+
<version>${http-components-version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.apache.httpcomponents</groupId>
66+
<artifactId>httpcore-osgi</artifactId>
67+
<version>${http-components-core-version}</version>
68+
</dependency>
5969
<dependency>
6070
<groupId>org.apache.httpcomponents</groupId>
6171
<artifactId>httpmime</artifactId>

osgi-itests/bnd.bnd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Export-Package: ${p}.it
2+
3+
Test-Cases: \
4+
${classes;CONCRETE;ANNOTATED;org.junit.Test}
5+
6+
p = com.basistech.rosette.osgi
7+
8+

osgi-itests/it.bndrun

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-standalone: target/index.xml
2+
# -runtrace: true
3+
-runfw: org.apache.felix.framework;version=5
4+
-runee: JavaSE-1.8
5+
6+
-runsystempackages: \
7+
sun.misc,org.slf4j
8+
9+
-resolve.effective: resolve, active
10+
11+
12+
-runrequires: \
13+
osgi.identity;filter:='(osgi.identity=rosette-api-osgi-itests)',\
14+
osgi.identity;filter:='(osgi.identity=slf4j.api)',\
15+
osgi.identity;filter:='(osgi.identity=slf4j.simple)',\
16+
osgi.identity;filter:='(osgi.identity=osgi.enroute.hamcrest.wrapper)',\
17+
osgi.identity;filter:='(osgi.identity=osgi.enroute.junit.wrapper)'
18+

osgi-itests/pom.xml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?xml version="1.0"?>
2+
<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">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>rosette-api-osgi-itests</artifactId>
5+
<parent>
6+
<groupId>com.basistech.rosette</groupId>
7+
<artifactId>rosette-api-java-binding</artifactId>
8+
<version>1.21.1-SNAPSHOT</version>
9+
</parent>
10+
<properties>
11+
<bundle-repo>target/test-bundles</bundle-repo>
12+
</properties>
13+
<dependencies>
14+
<dependency>
15+
<groupId>com.basistech.rosette</groupId>
16+
<artifactId>rosette-api</artifactId>
17+
<version>1.21.1-SNAPSHOT</version>
18+
</dependency>
19+
20+
<!-- minimum external requirements of rosette-api OSGi -->
21+
<!-- OSGi dependencies are sensitive to underlying bundles' requirements -->
22+
<!-- Transitive dependencies of rosette-api are used for resolving as well. -->
23+
<dependency>
24+
<groupId>com.basistech</groupId>
25+
<artifactId>common-api</artifactId>
26+
<version>37.0.1</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.apache.felix</groupId>
30+
<artifactId>org.apache.felix.framework</artifactId>
31+
<version>6.0.3</version>
32+
<scope>runtime</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.apache.felix</groupId>
36+
<artifactId>org.apache.felix.configadmin</artifactId>
37+
<version>1.8.10</version>
38+
<scope>compile</scope>
39+
</dependency>
40+
41+
<!-- SLF4J is part of rosette-osgi's system packages. -->
42+
<dependency>
43+
<groupId>org.slf4j</groupId>
44+
<artifactId>slf4j-api</artifactId>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.slf4j</groupId>
48+
<artifactId>slf4j-simple</artifactId>
49+
</dependency>
50+
51+
<!-- bnd-testing dependencies -->
52+
<dependency>
53+
<groupId>org.osgi</groupId>
54+
<artifactId>osgi.enroute.junit.wrapper</artifactId>
55+
<version>4.12.0</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.osgi</groupId>
59+
<artifactId>osgi.enroute.hamcrest.wrapper</artifactId>
60+
<version>1.3.0</version>
61+
</dependency>
62+
</dependencies>
63+
<build>
64+
<plugins>
65+
<!-- Copy all maven dependencies to the test OBR repo, skipping Compendium which is not resolvable. -->
66+
<plugin>
67+
<artifactId>maven-dependency-plugin</artifactId>
68+
<executions>
69+
<execution>
70+
<phase>pre-integration-test</phase>
71+
<id>copy-it-dependencies</id>
72+
<goals>
73+
<goal>copy-dependencies</goal>
74+
</goals>
75+
<configuration>
76+
<outputDirectory>${bundle-repo}</outputDirectory>
77+
<excludeArtifactIds>osgi.cmpn</excludeArtifactIds>
78+
</configuration>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
<!-- Build the OSGi MANIFEST.MF using the 'bnd' tool, reading the contents of bnd.bnd. -->
83+
<plugin>
84+
<groupId>biz.aQute.bnd</groupId>
85+
<artifactId>bnd-maven-plugin</artifactId>
86+
</plugin>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-jar-plugin</artifactId>
90+
<configuration>
91+
<archive>
92+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
93+
</archive>
94+
<outputDirectory>${bundle-repo}</outputDirectory>
95+
</configuration>
96+
</plugin>
97+
98+
<!-- Index the test bundle repo as OBR. -->
99+
<plugin>
100+
<groupId>biz.aQute.bnd</groupId>
101+
<artifactId>bnd-indexer-maven-plugin</artifactId>
102+
<version>3.5.0</version>
103+
<configuration>
104+
<inputDir>${bundle-repo}</inputDir>
105+
<includeJar>true</includeJar>
106+
</configuration>
107+
<executions>
108+
<execution>
109+
<id>index-repo</id>
110+
<phase>pre-integration-test</phase>
111+
<goals>
112+
<goal>local-index</goal>
113+
</goals>
114+
</execution>
115+
</executions>
116+
</plugin>
117+
118+
<!-- Invoke the main bundle with the test bundle repository. -->
119+
<plugin>
120+
<groupId>biz.aQute.bnd</groupId>
121+
<artifactId>bnd-testing-maven-plugin</artifactId>
122+
<version>3.5.0</version>
123+
<configuration>
124+
<failOnChanges>false</failOnChanges>
125+
<bndruns>
126+
<bndrun>it.bndrun</bndrun>
127+
</bndruns>
128+
<resolve>true</resolve>
129+
</configuration>
130+
<executions>
131+
<execution>
132+
<phase>integration-test</phase>
133+
<id>it-bnd-testing</id>
134+
<goals>
135+
<goal>testing</goal>
136+
</goals>
137+
</execution>
138+
</executions>
139+
</plugin>
140+
</plugins>
141+
</build>
142+
</project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2022 Basis Technology Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.basistech.rosette.osgi.it;
18+
19+
import com.basistech.rosette.api.HttpRosetteAPI;
20+
import org.junit.Test;
21+
22+
import static org.junit.Assert.assertNotNull;
23+
24+
public class RosetteApiOsgiTest {
25+
@Test
26+
public void smokeTest() {
27+
HttpRosetteAPI api = new HttpRosetteAPI.Builder().build();
28+
assertNotNull(api);
29+
}
30+
}

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<bnd-maven-plugin.version>3.2.0</bnd-maven-plugin.version>
4545
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
4646
<http-components-version>4.5.13</http-components-version>
47+
<http-components-core-version>4.4.15</http-components-core-version>
4748
<maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
4849
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
4950
<!-- There appears to be a regression between 3.0.0-M1 and 3.0.0 that causes
@@ -62,6 +63,7 @@
6263
<module>json</module>
6364
<module>common</module>
6465
<module>api</module>
66+
<module>osgi-itests</module>
6567
<module>examples</module>
6668
<module>release</module>
6769
</modules>

0 commit comments

Comments
 (0)