Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-6269

DynamicClassLoaderIT fails when the org.apache.sling.commons.osgi:2.1.0 Maven artifact is not available locally

    XMLWordPrintableJSON

Details

    Description

      The following code snippet tries to load the OSGi bundle from the filesystem

              final URL url = new URL(mavenBundle("org.apache.sling", "org.apache.sling.commons.osgi", "2.1.0").getURL());
              final InputStream is = url.openStream();
              Bundle osgiBundle = null;
              try {
                  osgiBundle = this.bundleContext.installBundle(url.toExternalForm(), is);
              } finally {
                  try { is.close(); } catch ( final IOException ignore) {}
              }
              assertNotNull(osgiBundle);
              assertEquals(Bundle.INSTALLED, osgiBundle.getState());
      

      Even though it's wrapped in a mavenBundle call, the bundle is not actually downloaded, so if the bundle is not available locally the test will fail.

      Attachments

        Activity

          People

            rombert Robert Munteanu
            rombert Robert Munteanu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: