This is an automated email from the ASF dual-hosted git repository.
enapps-enorman pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-metrics.git
The following commit(s) were added to refs/heads/master by this push:
new a76bbc1 SLING-12918 Update to Parent 66 (#10)
a76bbc1 is described below
commit a76bbc1e53c942d2a7c6a104f6280e21ad287b5d
Author: Eric Norman <[email protected]>
AuthorDate: Sun Apr 26 19:18:09 2026 -0700
SLING-12918 Update to Parent 66 (#10)
---
pom.xml | 33 ++++++++++++++++------
.../metrics/internal/BundleMetricsMapperTest.java | 5 ++--
.../metrics/test/MetricsServiceFactoryIT.java | 7 +++++
src/test/resources/exam.properties | 21 ++++++++++++++
4 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/pom.xml b/pom.xml
index ca9a3f4..afa560e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling-bundle-parent</artifactId>
- <version>62</version>
+ <version>66</version>
<relativePath />
</parent>
@@ -174,7 +174,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>5.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -236,12 +235,9 @@
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
- <systemProperties>
- <property>
- <name>bundle.filename</name>
-
<value>${basedir}/target/${project.build.finalName}.jar</value>
- </property>
- </systemProperties>
+ <systemPropertyVariables>
+
<bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
+ </systemPropertyVariables>
</configuration>
<executions>
<execution>
@@ -258,5 +254,26 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>jacoco-report</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- skip instrumentation to workaround a
jacoco "MethodTooLargeException: Method too large" exception -->
+
<exclude>org/htmlunit/css/StyleAttributes$Definition</exclude>
+ <!-- exclude the binary classes that were
copied from elsewhere -->
+
<exclude>org/apache/felix/utils/json/*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git
a/src/test/java/org/apache/sling/commons/metrics/internal/BundleMetricsMapperTest.java
b/src/test/java/org/apache/sling/commons/metrics/internal/BundleMetricsMapperTest.java
index df17b10..cee853d 100644
---
a/src/test/java/org/apache/sling/commons/metrics/internal/BundleMetricsMapperTest.java
+++
b/src/test/java/org/apache/sling/commons/metrics/internal/BundleMetricsMapperTest.java
@@ -20,8 +20,9 @@ package org.apache.sling.commons.metrics.internal;
import javax.management.ObjectName;
+import java.util.Map;
+
import com.codahale.metrics.MetricRegistry;
-import com.google.common.collect.ImmutableMap;
import org.apache.sling.testing.mock.osgi.MockBundle;
import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
import org.junit.Rule;
@@ -58,7 +59,7 @@ public class BundleMetricsMapperTest {
public void mappedName_Header() throws Exception {
MockBundle bundle = new MockBundle(context.bundleContext());
bundle.setSymbolicName("com.example");
-
bundle.setHeaders(ImmutableMap.of(BundleMetricsMapper.HEADER_DOMAIN_NAME,
"com.test"));
+ bundle.setHeaders(Map.of(BundleMetricsMapper.HEADER_DOMAIN_NAME,
"com.test"));
mapper.addMapping("bar", bundle);
diff --git
a/src/test/java/org/apache/sling/commons/metrics/test/MetricsServiceFactoryIT.java
b/src/test/java/org/apache/sling/commons/metrics/test/MetricsServiceFactoryIT.java
index cc4a0f5..dfc67bd 100644
---
a/src/test/java/org/apache/sling/commons/metrics/test/MetricsServiceFactoryIT.java
+++
b/src/test/java/org/apache/sling/commons/metrics/test/MetricsServiceFactoryIT.java
@@ -29,12 +29,14 @@ import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
+import static org.apache.sling.testing.paxexam.SlingOptions.paxLoggingApi;
import static org.apache.sling.testing.paxexam.SlingOptions.scr;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.ops4j.pax.exam.CoreOptions.junitBundles;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
@@ -45,6 +47,11 @@ public class MetricsServiceFactoryIT extends TestSupport {
return options(
baseConfiguration(),
scr(),
+
+ // SLING-12918 newer version to provide the 2.x version of
slf4j
+ paxLoggingApi(),
+
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+
// Commons Metrics
testBundle("bundle.filename"),
mavenBundle()
diff --git a/src/test/resources/exam.properties
b/src/test/resources/exam.properties
new file mode 100644
index 0000000..5a487a5
--- /dev/null
+++ b/src/test/resources/exam.properties
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+# SLING-12918 Disable the default bundles provisioned under pax logging
+pax.exam.logging=none