Skip to content

Commit 30db933

Browse files
committed
ARIES-2165: Build application with java 8
1 parent cc19d6b commit 30db933

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6330
-35
lines changed

.github/workflows/application.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
name: Appliaction - CI Build
14+
15+
on:
16+
pull_request:
17+
paths:
18+
- parent/**
19+
- application/**
20+
- .github/workflows/application.yml
21+
push:
22+
branches:
23+
- 'trunk'
24+
25+
env:
26+
LC_ALL: en_US.UTF-8
27+
28+
jobs:
29+
JDKxx_Matrix:
30+
timeout-minutes: 10
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
java: [ 8 ]
35+
os: [ ubuntu-latest ]
36+
name: JDK${{ matrix.java }} ${{ matrix.os }}
37+
runs-on: ${{ matrix.os }}
38+
steps:
39+
- name: Git Checkout
40+
uses: actions/checkout@v4
41+
- name: Set up Java
42+
uses: actions/setup-java@v4
43+
with:
44+
distribution: 'temurin'
45+
java-version: ${{ matrix.java }}
46+
- name: Build
47+
shell: bash
48+
run: |
49+
mvn -U -e -B -ntp clean install -f parent/pom.xml
50+
mvn -U -e -B -ntp clean install -f application/pom.xml

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ model.
55

66
See [Apache Aries Website](http://aries.apache.org/).
77

8-
- Application - the implementation is using `org.osgi.service.framework` from Eclipse Equinox that is [available only in versions 3.5..3.7](https://bugs.eclipse.org/bugs/show_bug.cgi?id=345790)
8+
- [![Application - CI Build](https://github.com/apache/aries/actions/workflows/application.yml/badge.svg)](https://github.com/apache/aries/actions/workflows/application.yml) - the implementation is using `org.osgi.service.framework` from Eclipse Equinox that is [available only in versions 3.5..3.7](https://bugs.eclipse.org/bugs/show_bug.cgi?id=345790)
99
- [![Async - CI Build](https://github.com/apache/aries/actions/workflows/async.yml/badge.svg)](https://github.com/apache/aries/actions/workflows/async.yml)
1010
- [![Blueprint - CI Build](https://github.com/apache/aries/actions/workflows/blueprint.yml/badge.svg)](https://github.com/apache/aries/actions/workflows/blueprint.yml)
1111
- [![eba-maven-plugin - CI Build](https://github.com/apache/aries/actions/workflows/eba-maven-plugin.yml/badge.svg)](https://github.com/apache/aries/actions/workflows/eba-maven-plugin.yml)

application/application-itests/pom.xml

+20-12
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.aries</groupId>
2626
<artifactId>parent</artifactId>
27-
<version>2.0.0</version>
27+
<version>2.1.2-SNAPSHOT</version>
2828
<relativePath>../../parent/pom.xml</relativePath>
2929
</parent>
3030

@@ -46,8 +46,9 @@
4646
<properties>
4747
<asm-all.version>5.0.3</asm-all.version>
4848
<depends-maven-plugin.version>1.3</depends-maven-plugin.version>
49-
<exam.version>4.5.0</exam.version>
49+
<exam.version>4.13.5</exam.version>
5050
<geronimo-jta_1.1_spec.version>1.1.1</geronimo-jta_1.1_spec.version>
51+
<javax.inject.version>1</javax.inject.version>
5152
<org.apache.aries.application.default.local.platform.version>1.0.0</org.apache.aries.application.default.local.platform.version>
5253
<org.apache.aries.application.management.version>1.0.0</org.apache.aries.application.management.version>
5354
<org.apache.aries.application.resolve.transform.cm.version>1.0.0</org.apache.aries.application.resolve.transform.cm.version>
@@ -61,14 +62,14 @@
6162
<org.apache.aries.application.runtime.version>1.0.0</org.apache.aries.application.runtime.version>
6263
<org.apache.aries.application.utils.version>1.0.0</org.apache.aries.application.utils.version>
6364
<org.apache.aries.blueprint.version>1.0.0</org.apache.aries.blueprint.version>
64-
<org.apache.aries.proxy.version>1.0.2-SNAPSHOT</org.apache.aries.proxy.version>
65-
<org.apache.aries.testsupport.unit.version>2.0.0-SNAPSHOT</org.apache.aries.testsupport.unit.version>
65+
<org.apache.aries.proxy.version>1.1.0</org.apache.aries.proxy.version>
66+
<!-- <org.apache.aries.testsupport.unit.version>2.0.0-SNAPSHOT</org.apache.aries.testsupport.unit.version>-->
6667
<org.apache.aries.transaction.blueprint.version>1.0.0</org.apache.aries.transaction.blueprint.version>
6768
<org.apache.aries.util.version>1.0.0</org.apache.aries.util.version>
6869
<org.apache.felix.bundlerepository.version>1.6.4</org.apache.felix.bundlerepository.version>
6970
<org.apache.felix.configadmin.version>1.2.4</org.apache.felix.configadmin.version>
7071
<org.eclipse.osgi.version>3.8.0.v20120529-1548</org.eclipse.osgi.version>
71-
<url.version>2.2.0</url.version>
72+
<url.version>2.5.3</url.version>
7273
</properties>
7374

7475
<dependencies>
@@ -128,12 +129,13 @@
128129
<version>${url.version}</version>
129130
<scope>test</scope>
130131
</dependency>
131-
<dependency>
132-
<groupId>org.apache.aries.testsupport</groupId>
133-
<artifactId>org.apache.aries.testsupport.unit</artifactId>
134-
<version>${org.apache.aries.testsupport.unit.version}</version>
135-
<scope>test</scope>
136-
</dependency>
132+
<!-- TODO ARIES-2165 Use testsupport dependency when application runs on newer eclispe -->
133+
<!-- <dependency>-->
134+
<!-- <groupId>org.apache.aries.testsupport</groupId>-->
135+
<!-- <artifactId>org.apache.aries.testsupport.unit</artifactId>-->
136+
<!-- <version>${org.apache.aries.testsupport.unit.version}</version>-->
137+
<!-- <scope>test</scope>-->
138+
<!-- </dependency>-->
137139

138140
<!-- bundles -->
139141
<dependency>
@@ -264,6 +266,11 @@
264266
<version>${geronimo-jta_1.1_spec.version}</version>
265267
<scope>test</scope>
266268
</dependency>
269+
<dependency>
270+
<groupId>javax.inject</groupId>
271+
<artifactId>javax.inject</artifactId>
272+
<version>${javax.inject.version}</version>
273+
</dependency>
267274
</dependencies>
268275

269276
<build>
@@ -288,7 +295,8 @@
288295
<groupId>org.apache.maven.plugins</groupId>
289296
<artifactId>maven-surefire-plugin</artifactId>
290297
<configuration>
291-
<forkMode>pertest</forkMode>
298+
<forkCount>1</forkCount>
299+
<reuseForks>false</reuseForks>
292300
<excludes>
293301
<exclude>**/*$*</exclude>
294302
<exclude>**/Abstract*.java</exclude>

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ public static Option[] configuration() {
147147
return options(
148148

149149
// framework / core bundles
150+
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
151+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
150152
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
151153
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
152154

@@ -155,7 +157,7 @@ public static Option[] configuration() {
155157

156158
// Bundles
157159
junitBundles(),
158-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
160+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
159161
mavenBundle("org.apache.aries.application", "org.apache.aries.application.api").versionAsInProject(),
160162
mavenBundle("org.apache.aries.application", "org.apache.aries.application.utils").versionAsInProject(),
161163
mavenBundle("org.apache.aries.application", "org.apache.aries.application.deployment.management").versionAsInProject(),

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicNoOpResolverTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public static Option[] configuration() {
124124

125125
// framework / core bundles
126126
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
127+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
127128
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
128129
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
129130

@@ -132,7 +133,7 @@ public static Option[] configuration() {
132133

133134
// Bundles
134135
junitBundles(),
135-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
136+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
136137
mavenBundle("org.apache.aries.application", "org.apache.aries.application.api").versionAsInProject(),
137138
mavenBundle("org.apache.aries.application", "org.apache.aries.application.utils").versionAsInProject(),
138139
mavenBundle("org.apache.aries.application", "org.apache.aries.application.deployment.management").versionAsInProject(),

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/IsolatedCfgAdminRuntimeTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ public static Option[] configuration() throws Exception {
367367

368368
// framework / core bundles
369369
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
370+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
370371
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
371372
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
372373

@@ -378,7 +379,7 @@ public static Option[] configuration() throws Exception {
378379

379380
// Bundles
380381
junitBundles(),
381-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
382+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
382383

383384
// Bundles
384385
mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/IsolatedRuntimeTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ public static Option[] configuration() {
315315

316316
// framework / core bundles
317317
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
318+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
318319
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
319320
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
320321

@@ -326,7 +327,7 @@ public static Option[] configuration() {
326327

327328
// Bundles
328329
junitBundles(),
329-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
330+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
330331

331332
// Bundles
332333
mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public static Option[] configuration() {
174174

175175
// framework / core bundles
176176
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
177+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
177178
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
178179
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
179180

@@ -182,7 +183,7 @@ public static Option[] configuration() {
182183

183184
// Bundles
184185
junitBundles(),
185-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
186+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
186187

187188
// Bundles
188189
mavenBundle("org.apache.aries.application", "org.apache.aries.application.api").versionAsInProject(),
@@ -197,6 +198,7 @@ public static Option[] configuration() {
197198
mavenBundle("org.apache.aries.application", "org.apache.aries.application.modeller").versionAsInProject(),
198199
mavenBundle("org.apache.aries.application", "org.apache.aries.application.deployment.management").versionAsInProject(),
199200
mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),
201+
// mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.cm").versionAsInProject().start(),
200202
mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
201203
mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy").versionAsInProject());
202204
}

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public static Option[] configuration() {
155155

156156
// framework / core bundles
157157
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
158+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
158159
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
159160
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
160161

@@ -163,7 +164,7 @@ public static Option[] configuration() {
163164

164165
// Bundles
165166
junitBundles(),
166-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
167+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
167168

168169
// Bundles
169170
mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ public static Option[] configuration() {
532532

533533
// framework / core bundles
534534
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
535+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
535536
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
536537
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
537538

@@ -540,7 +541,7 @@ public static Option[] configuration() {
540541

541542
// Bundles
542543
junitBundles(),
543-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
544+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
544545

545546
// Bundles
546547
mavenBundle("org.apache.aries.application", "org.apache.aries.application.api").versionAsInProject(),

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ public static Option[] configuration() {
318318

319319
// framework / core bundles
320320
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
321+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
321322
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
322323
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
323324

@@ -326,7 +327,7 @@ public static Option[] configuration() {
326327

327328
// Bundles
328329
junitBundles(),
329-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
330+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
330331

331332
// Bundles
332333
mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),

application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/UpdateAppTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ public static Option[] configuration() {
256256

257257
// framework / core bundles
258258
mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
259+
mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
259260
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
260261
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
261262

@@ -267,7 +268,7 @@ public static Option[] configuration() {
267268

268269
// Bundles
269270
junitBundles(),
270-
mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
271+
// mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
271272
mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),
272273
mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
273274
mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy").versionAsInProject(),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.aries.itest;
20+
21+
import javax.inject.Inject;
22+
23+
import org.osgi.framework.Bundle;
24+
import org.osgi.framework.BundleContext;
25+
import org.osgi.framework.BundleException;
26+
27+
/**
28+
* TODO ARIES-2165 Remove when testsupport is added in pom
29+
*
30+
* Base class for Pax Exam 1.2.x based unit tests
31+
*
32+
* Contains the injection point and various utilities used in most tests
33+
*/
34+
public abstract class AbstractIntegrationTest {
35+
36+
/** Gateway to the test OSGi framework */
37+
@Inject
38+
protected BundleContext bundleContext;
39+
40+
/**
41+
* Get a richer version of {@link BundleContext}
42+
*/
43+
public RichBundleContext context() {
44+
return new RichBundleContext(bundleContext);
45+
}
46+
47+
public String getLocalRepo() {
48+
String localRepo = System.getProperty("maven.repo.local");
49+
if (localRepo == null) {
50+
localRepo = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
51+
}
52+
return localRepo;
53+
}
54+
55+
56+
/**
57+
* Help to diagnose bundles that did not start
58+
*
59+
* @throws BundleException
60+
*/
61+
public void showBundles() throws BundleException {
62+
Bundle[] bundles = bundleContext.getBundles();
63+
for (Bundle bundle : bundles) {
64+
System.out.println(bundle.getBundleId() + ":" + bundle.getSymbolicName() + ":" + bundle.getVersion() + ":" + bundle.getState());
65+
}
66+
}
67+
68+
/**
69+
* Helps to diagnose bundles that are not resolved as it will throw a detailed exception
70+
*
71+
* @throws BundleException
72+
*/
73+
public void resolveBundles() throws BundleException {
74+
Bundle[] bundles = bundleContext.getBundles();
75+
for (Bundle bundle : bundles) {
76+
if (bundle.getState() == Bundle.INSTALLED) {
77+
System.out.println("Found non resolved bundle " + bundle.getBundleId() + ":" + bundle.getSymbolicName() + ":" + bundle.getVersion());
78+
bundle.start();
79+
}
80+
}
81+
}
82+
}

0 commit comments

Comments
 (0)