You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2025/01/21 15:24:01 UTC
(sling-org-apache-sling-launchpad-integration-tests) branch issue/SLING-12367 created (now 46fb370)
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a change to branch issue/SLING-12367
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-integration-tests.git
at 46fb370 SLING-12367 - MBean platform server not registered for Sling Starter
This branch includes the following new commits:
new 46fb370 SLING-12367 - MBean platform server not registered for Sling Starter
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(sling-org-apache-sling-launchpad-integration-tests) 01/01: SLING-12367 - MBean platform server not registered for Sling Starter
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch issue/SLING-12367
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-integration-tests.git
commit 46fb3702bcfc4ef8f6d812cc9da909efaff9d1f7
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Jan 21 16:23:09 2025 +0100
SLING-12367 - MBean platform server not registered for Sling Starter
Add a JmxTest that validates registered MBeans for the org.apache.sling domain. The particular
MBean under test is only registered when a MBeanServer is available.
---
.../webapp/integrationtest/jmx/JmxTest.java | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/jmx/JmxTest.java b/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/jmx/JmxTest.java
new file mode 100644
index 0000000..9e1469c
--- /dev/null
+++ b/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/jmx/JmxTest.java
@@ -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.sling.launchpad.webapp.integrationtest.jmx;
+
+import javax.json.JsonValue;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.sling.commons.testing.integration.HttpTestBase;
+import org.apache.sling.launchpad.webapp.integrationtest.util.JsonUtil;
+
+/**
+ * The <tt>DomTest</tt> verifies that simple DOM executions are successful
+ *
+ */
+public class JmxTest extends HttpTestBase {
+
+ private static final String DEFAULT_THREADPOOL_OBJECTNAME =
+ "\"org.apache.sling:type=threads,service=ThreadPool,name=default\"";
+
+ public void testSlingJmxMBeansListing() throws IOException {
+
+ String content = getContent(HTTP_BASE_URL + "/bin/jmx.json", CONTENT_TYPE_JSON);
+
+ List<String> slingMBeanNames =
+ JsonUtil.parseArray(content).stream().map(JsonValue::toString).collect(Collectors.toList());
+
+ assertTrue("Expecting at least one Sling MBean", !slingMBeanNames.isEmpty());
+ boolean found = slingMBeanNames.contains(DEFAULT_THREADPOOL_OBJECTNAME);
+ assertTrue("Expecting " + DEFAULT_THREADPOOL_OBJECTNAME + " to be listed in " + slingMBeanNames, found);
+ }
+}