Skip to content

Commit 0c2a940

Browse files
authored
Merge pull request #589 from apache/FELIX-6875-build-unbuilt-modules
FELIX-6875 - Build and test the modules CI never covered on JDK 21 and 25
2 parents f19890c + 0b3c5d9 commit 0c2a940

25 files changed

Lines changed: 173 additions & 67 deletions

File tree

‎.github/workflows/maven-ci.yml‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ on:
2323
- 'log.extension/**'
2424
- 'examples/**'
2525
- 'configadmin/**'
26+
- 'healthcheck/**'
27+
- 'fileinstall/**'
28+
- 'inventory/**'
29+
- 'configadmin-plugins/**'
30+
- 'webconsole-plugins/**'
31+
- 'metatype/**'
32+
- 'coordinator/**'
33+
- 'features/**'
34+
- 'scr-ext-anno/**'
35+
- 'bundlerepository.osgi-ct/**'
2636
pull_request:
2737
branches: [ "master", "feature/**", "maintenance/**" ]
2838
paths:
@@ -45,6 +55,16 @@ on:
4555
- 'log.extension/**'
4656
- 'examples/**'
4757
- 'configadmin/**'
58+
- 'healthcheck/**'
59+
- 'fileinstall/**'
60+
- 'inventory/**'
61+
- 'configadmin-plugins/**'
62+
- 'webconsole-plugins/**'
63+
- 'metatype/**'
64+
- 'coordinator/**'
65+
- 'features/**'
66+
- 'scr-ext-anno/**'
67+
- 'bundlerepository.osgi-ct/**'
4868

4969
# Cancel superseded runs for the same branch. github.head_ref is only set for
5070
# pull_request events, so pushes fall back to github.ref, which groups per branch:
@@ -118,6 +138,26 @@ jobs:
118138
- 'log.extension/**'
119139
examples:
120140
- 'examples/**'
141+
healthcheck:
142+
- 'healthcheck/**'
143+
fileinstall:
144+
- 'fileinstall/**'
145+
inventory:
146+
- 'inventory/**'
147+
configadmin-plugins:
148+
- 'configadmin-plugins/**'
149+
webconsole-plugins:
150+
- 'webconsole-plugins/**'
151+
metatype:
152+
- 'metatype/**'
153+
coordinator:
154+
- 'coordinator/**'
155+
features:
156+
- 'features/**'
157+
scr-ext-anno:
158+
- 'scr-ext-anno/**'
159+
bundlerepository-osgi-ct:
160+
- 'bundlerepository.osgi-ct/**'
121161
- name: Felix Configuration JSON
122162
if: steps.changes.outputs.cm-json == 'true' || steps.changes.outputs.configurator == 'true'
123163
run: mvn -B -V -Dstyle.color=always --file cm.json/pom.xml clean install
@@ -196,6 +236,44 @@ jobs:
196236
- name: Felix examples
197237
if: steps.changes.outputs.examples == 'true'
198238
run: mvn -B -V -Dstyle.color=always --file examples/pom.xml clean verify
239+
# The modules below are not part of a reactor and each pins the released Felix
240+
# bundles it depends on, so they are built one by one. See FELIX-6875.
241+
- name: Felix Health Check
242+
if: steps.changes.outputs.healthcheck == 'true'
243+
run: |
244+
for module in annotation api core generalchecks webconsoleplugin; do
245+
mvn -B -V -Dstyle.color=always --file healthcheck/$module/pom.xml clean verify || exit 1
246+
done
247+
- name: Felix File Install
248+
if: steps.changes.outputs.fileinstall == 'true'
249+
run: mvn -B -V -Dstyle.color=always --file fileinstall/pom.xml clean verify
250+
- name: Felix Inventory
251+
if: steps.changes.outputs.inventory == 'true'
252+
run: mvn -B -V -Dstyle.color=always --file inventory/pom.xml clean verify
253+
- name: Felix Config Admin plugins
254+
if: steps.changes.outputs.configadmin-plugins == 'true'
255+
run: mvn -B -V -Dstyle.color=always --file configadmin-plugins/interpolation/pom.xml clean verify
256+
- name: Felix Web Console plugins
257+
if: steps.changes.outputs.webconsole-plugins == 'true'
258+
run: |
259+
for module in ds event memoryusage obr packageadmin; do
260+
mvn -B -V -Dstyle.color=always --file webconsole-plugins/$module/pom.xml clean verify || exit 1
261+
done
262+
- name: Felix Metatype
263+
if: steps.changes.outputs.metatype == 'true'
264+
run: mvn -B -V -Dstyle.color=always --file metatype/pom.xml clean verify
265+
- name: Felix Coordinator
266+
if: steps.changes.outputs.coordinator == 'true'
267+
run: mvn -B -V -Dstyle.color=always --file coordinator/pom.xml clean verify
268+
- name: Felix Features
269+
if: steps.changes.outputs.features == 'true'
270+
run: mvn -B -V -Dstyle.color=always --file features/pom.xml clean verify
271+
- name: Felix SCR extension annotations
272+
if: steps.changes.outputs.scr-ext-anno == 'true'
273+
run: mvn -B -V -Dstyle.color=always --file scr-ext-anno/pom.xml clean verify
274+
- name: Felix bundlerepository OSGi CT
275+
if: steps.changes.outputs.bundlerepository-osgi-ct == 'true'
276+
run: mvn -B -V -Dstyle.color=always --file bundlerepository.osgi-ct/pom.xml clean verify
199277
- name: Upload Test Results
200278
if: always()
201279
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎bundlerepository.osgi-ct/pom.xml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<parent>
2121
<groupId>org.apache.felix</groupId>
2222
<artifactId>felix-parent</artifactId>
23-
<version>2.1</version>
24-
<relativePath>../../pom/pom.xml</relativePath>
23+
<version>9</version>
24+
<relativePath />
2525
</parent>
2626
<modelVersion>4.0.0</modelVersion>
2727
<packaging>bundle</packaging>
@@ -52,7 +52,7 @@
5252
<dependency>
5353
<groupId>${project.groupId}</groupId>
5454
<artifactId>org.apache.felix.bundlerepository</artifactId>
55-
<version>${project.version}</version>
55+
<version>2.0.10</version>
5656
</dependency>
5757
</dependencies>
5858
<build>
@@ -61,15 +61,15 @@
6161
<groupId>org.apache.maven.plugins</groupId>
6262
<artifactId>maven-compiler-plugin</artifactId>
6363
<configuration>
64-
<target>1.5</target>
65-
<source>1.5</source>
64+
<target>8</target>
65+
<source>8</source>
6666
</configuration>
6767
</plugin>
6868

6969
<plugin>
7070
<groupId>org.apache.felix</groupId>
7171
<artifactId>maven-bundle-plugin</artifactId>
72-
<version>2.3.4</version>
72+
<version>6.2.0</version>
7373
<extensions>true</extensions>
7474
<configuration>
7575
<instructions>

‎configadmin-plugins/interpolation/pom.xml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<parent>
2323
<groupId>org.apache.felix</groupId>
2424
<artifactId>felix-parent</artifactId>
25-
<version>7</version>
26-
<relativePath>../../../pom/pom.xml</relativePath>
25+
<version>9</version>
26+
<relativePath />
2727
</parent>
2828

2929
<artifactId>org.apache.felix.configadmin.plugin.interpolation</artifactId>
@@ -133,8 +133,8 @@
133133
</dependency>
134134
<dependency>
135135
<groupId>org.mockito</groupId>
136-
<artifactId>mockito-all</artifactId>
137-
<version>1.10.19</version>
136+
<artifactId>mockito-core</artifactId>
137+
<version>5.18.0</version>
138138
<scope>test</scope>
139139
</dependency>
140140
<dependency>

‎coordinator/pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<parent>
2323
<groupId>org.apache.felix</groupId>
2424
<artifactId>felix-parent</artifactId>
25-
<version>6</version>
26-
<relativePath>../pom/pom.xml</relativePath>
25+
<version>9</version>
26+
<relativePath />
2727
</parent>
2828

2929
<artifactId>org.apache.felix.coordinator</artifactId>

‎features/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<parent>
1616
<groupId>org.apache.felix</groupId>
1717
<artifactId>felix-parent</artifactId>
18-
<version>7</version>
18+
<version>9</version>
1919
<relativePath />
2020
</parent>
2121

‎fileinstall/pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<parent>
2121
<groupId>org.apache.felix</groupId>
2222
<artifactId>felix-parent</artifactId>
23-
<version>6</version>
24-
<relativePath>../pom/pom.xml</relativePath>
23+
<version>9</version>
24+
<relativePath />
2525
</parent>
2626

2727
<modelVersion>4.0.0</modelVersion>

‎fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -237,39 +237,42 @@ public void testIsFragment() throws Exception
237237

238238
public void testInvalidTempDir() throws Exception
239239
{
240-
String oldTmpDir = System.getProperty("java.io.tmpdir");
241-
242-
try
240+
// java.io.tmpdir is read once when the JVM starts (JDK 12 and later), so setting it
241+
// here would have no effect. Point File Install at the invalid directory through its
242+
// own setting instead.
243+
File parent = new File("target/tmp");
244+
parent.mkdirs();
245+
parent.setWritable(false, false);
246+
try
243247
{
244-
File parent = new File("target/tmp");
245-
parent.mkdirs();
246-
parent.setWritable(false, false);
247248
File tmp = new File(parent, "tmp");
248-
System.setProperty("java.io.tmpdir", tmp.toString());
249+
props.put(DirectoryWatcher.TMPDIR, tmp.toString());
249250

250251
mockBundleContext.addBundleListener((BundleListener) org.easymock.EasyMock.anyObject());
251252
EasyMock.expect(mockBundleContext.createFilter((String) EasyMock.anyObject()))
252253
.andReturn(null);
254+
// Creating the folder fails, which is logged; the logger asks for a LogService.
255+
EasyMock.expect(mockBundleContext.getServiceReference(LogService.class)).andReturn(null).anyTimes();
253256

254257
BundleRevision mockBundleRevision = EasyMock.createNiceMock(BundleRevision.class);
255258
EasyMock.expect(mockBundle.adapt(BundleRevision.class)).andReturn(mockBundleRevision);
256259
EasyMock.expect(mockBundleRevision.getTypes())
257260
.andReturn(BundleRevision.TYPE_FRAGMENT);
258261
EasyMock.replay(mockBundleContext, mockBundle, mockBundleRevision, mockSysBundle, mockStartLevel);
259-
262+
260263
try
261264
{
262265
dw = new DirectoryWatcher( new FileInstall(), props, mockBundleContext );
263-
fail("Expected an IllegalStateException");
264-
}
265-
catch (IllegalStateException e)
266+
fail("Expected an exception for a temp directory that cannot be created");
267+
}
268+
catch (RuntimeException e)
266269
{
267-
// expected
270+
assertTrue(e.getMessage(), e.getMessage().contains("Cannot create folder"));
268271
}
269272
}
270273
finally
271274
{
272-
System.setProperty("java.io.tmpdir", oldTmpDir);
275+
parent.setWritable(true, false);
273276
}
274277
}
275278

‎healthcheck/annotation/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.felix</groupId>
2525
<artifactId>felix-parent</artifactId>
26-
<version>6</version>
26+
<version>9</version>
2727
<relativePath />
2828
</parent>
2929

‎healthcheck/api/pom.xml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.felix</groupId>
2525
<artifactId>felix-parent</artifactId>
26-
<version>6</version>
26+
<version>9</version>
2727
<relativePath />
2828
</parent>
2929

@@ -50,7 +50,7 @@
5050
<plugin>
5151
<groupId>biz.aQute.bnd</groupId>
5252
<artifactId>bnd-maven-plugin</artifactId>
53-
<version>4.1.0</version>
53+
<version>7.1.0</version>
5454
<executions>
5555
<execution>
5656
<goals>
@@ -71,7 +71,7 @@
7171
<plugin>
7272
<groupId>org.apache.felix</groupId>
7373
<artifactId>maven-bundle-plugin</artifactId>
74-
<version>4.1.0</version>
74+
<version>5.1.8</version>
7575
<executions>
7676
<execution>
7777
<id>baseline</id>
@@ -112,7 +112,7 @@
112112
<dependency>
113113
<groupId>org.mockito</groupId>
114114
<artifactId>mockito-core</artifactId>
115-
<version>1.9.5</version>
115+
<version>5.18.0</version>
116116
<scope>test</scope>
117117
</dependency>
118118

‎healthcheck/api/src/test/java/org/apache/felix/hc/api/execution/HealthCheckMetadataTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import static org.junit.Assert.assertEquals;
2121
import static org.mockito.Mockito.when;
22-
import static org.mockito.MockitoAnnotations.initMocks;
22+
import static org.mockito.MockitoAnnotations.openMocks;
2323

2424
import java.util.Arrays;
2525
import java.util.Vector;
@@ -38,7 +38,7 @@ public class HealthCheckMetadataTest {
3838

3939
@Before
4040
public void setup() {
41-
initMocks(this);
41+
openMocks(this);
4242
when(hcServiceRef.getProperty(Constants.SERVICE_ID)).thenReturn(1L);
4343
}
4444

0 commit comments

Comments
 (0)