From commits-return-71501-archive-asf-public=cust-asf.ponee.io@commons.apache.org Sun Dec 29 18:16:32 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id D858D18063F for ; Sun, 29 Dec 2019 19:16:31 +0100 (CET) Received: (qmail 92783 invoked by uid 500); 29 Dec 2019 18:16:31 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 92773 invoked by uid 99); 29 Dec 2019 18:16:31 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Dec 2019 18:16:31 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id F246B8D80D; Sun, 29 Dec 2019 18:16:30 +0000 (UTC) Date: Sun, 29 Dec 2019 18:16:30 +0000 To: "commits@commons.apache.org" Subject: [commons-compress] branch master updated: COMPRESS-498 ensure the bundle name doesn't change without notice MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <157764339092.25260.6708549050868035980@gitbox.apache.org> From: bodewig@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: commons-compress X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 11edea657038529fea5e36f180f590bf20107cd1 X-Git-Newrev: 672fe1d006430a1526e4fb81b6b7476c76b7d028 X-Git-Rev: 672fe1d006430a1526e4fb81b6b7476c76b7d028 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. bodewig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git The following commit(s) were added to refs/heads/master by this push: new 672fe1d COMPRESS-498 ensure the bundle name doesn't change without notice 672fe1d is described below commit 672fe1d006430a1526e4fb81b6b7476c76b7d028 Author: Stefan Bodewig AuthorDate: Sun Dec 29 19:15:41 2019 +0100 COMPRESS-498 ensure the bundle name doesn't change without notice --- .../org/apache/commons/compress/OsgiITest.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/test/java/org/apache/commons/compress/OsgiITest.java b/src/test/java/org/apache/commons/compress/OsgiITest.java index fe13d71..2e9a07a 100644 --- a/src/test/java/org/apache/commons/compress/OsgiITest.java +++ b/src/test/java/org/apache/commons/compress/OsgiITest.java @@ -18,6 +18,7 @@ */ package org.apache.commons.compress; +import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.bundle; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; @@ -28,10 +29,19 @@ import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; + +import javax.inject.Inject; @RunWith(PaxExam.class) public class OsgiITest { + private static final String EXPECTED_BUNDLE_NAME = "org.apache.commons.commons-compress"; + + @Inject + private BundleContext ctx; + @Configuration public Option[] config() { return new Option[] { @@ -51,5 +61,18 @@ public class OsgiITest { @Test public void loadBundle() { + final StringBuilder bundles = new StringBuilder(); + boolean foundCompressBundle = false, first = true; + for (final Bundle b : ctx.getBundles()) { + final String symbolicName = b.getSymbolicName(); + foundCompressBundle |= EXPECTED_BUNDLE_NAME.equals(symbolicName); + if (!first) { + bundles.append(", "); + } + first = false; + bundles.append(symbolicName); + } + assertTrue("Expected to find bundle " + EXPECTED_BUNDLE_NAME + " in " + bundles, + foundCompressBundle); } }