felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1791891 - in /felix/trunk/bundlerepository/src: main/java/org/apache/felix/bundlerepository/impl/ test/java/org/apache/felix/bundlerepository/impl/ test/resources/
Date Wed, 19 Apr 2017 09:44:52 GMT
Author: davidb
Date: Wed Apr 19 09:44:52 2017
New Revision: 1791891

URL: http://svn.apache.org/viewvc?rev=1791891&view=rev
Log:
FELIX-5611 BundleRepository must deal properly R5 index file with resources with relative
path from the given repository’s URL

Committing patch on behalf of Cristiano Gavião with many thanks!
This closes https://github.com/apache/felix/pull/101


Added:
    felix/trunk/bundlerepository/src/test/resources/spec_repository.zip   (with props)
Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/DataModelHelperImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PullParser.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryParser.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
    felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryXMLTest.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/DataModelHelperImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/DataModelHelperImpl.java?rev=1791891&r1=1791890&r2=1791891&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/DataModelHelperImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/DataModelHelperImpl.java
Wed Apr 19 09:44:52 2017
@@ -101,7 +101,7 @@ public class DataModelHelperImpl impleme
                 ZipEntry entry = zin.getNextEntry();
                 while (entry != null)
                 {
-                    if (entry.getName().equals("repository.xml"))
+                    if (entry.getName().equals("repository.xml") || entry.getName().equals("index.xml"))
                     {
                         is = zin;
                         break;
@@ -132,9 +132,13 @@ public class DataModelHelperImpl impleme
 
             if (is != null)
             {
-                RepositoryImpl repository = repository(is);
-                repository.setURI(url.toExternalForm());
-                return repository;
+                String repostr = url.toExternalForm();
+                if (repostr.endsWith("zip")) {
+                    repostr = "jar:".concat(repostr).concat("!/");
+                } else if (repostr.endsWith(".xml")) {
+                    repostr = repostr.substring(0, repostr.lastIndexOf('/')+1);
+                }
+                return repository(is, repostr);
             }
             else
             {
@@ -158,10 +162,11 @@ public class DataModelHelperImpl impleme
         }
     }
 
-    public RepositoryImpl repository(InputStream is) throws Exception
+    public RepositoryImpl repository(InputStream is, String uri) throws Exception
     {
         RepositoryParser parser = RepositoryParser.getParser();
-        RepositoryImpl repository = parser.parseRepository(is);
+        RepositoryImpl repository = parser.parseRepository(is, uri);
+        
         return repository;
     }
 

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PullParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PullParser.java?rev=1791891&r1=1791890&r2=1791891&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PullParser.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PullParser.java
Wed Apr 19 09:44:52 2017
@@ -36,7 +36,7 @@ public class PullParser extends Reposito
     {
     }
 
-    public RepositoryImpl parseRepository(InputStream is) throws Exception
+    public RepositoryImpl parseRepository(InputStream is, String repositoryURI) throws Exception
     {
         XmlPullParser reader = new KXmlParser();
 
@@ -50,14 +50,17 @@ public class PullParser extends Reposito
             throw new Exception("Expected element 'repository' at the root of the document");
         }
 
+        RepositoryImpl repo;
         if ("http://www.osgi.org/xmlns/repository/v1.0.0".equals(reader.getNamespace()))
             // TODO there are a bunch of other methods here that create a parser, should
they be updated too?
             // at the very least they should be made namespace-aware too, so that parsing
is the same no matter
             // how its initiated.
-            return SpecXMLPullParser.parse(reader);
+            return SpecXMLPullParser.parse(reader, repositoryURI);
         else
             // We're parsing the old
-            return parse(reader);
+            repo = parse(reader);
+            repo.setURI(repositoryURI);
+            return repo;
     }
 
     public RepositoryImpl parseRepository(Reader r) throws Exception

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryParser.java?rev=1791891&r1=1791890&r2=1791891&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryParser.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryParser.java
Wed Apr 19 09:44:52 2017
@@ -71,7 +71,7 @@ public abstract class RepositoryParser
     }
 
 
-    public abstract RepositoryImpl parseRepository(InputStream is) throws Exception;
+    public abstract RepositoryImpl parseRepository(InputStream is, String repositoryURI)
throws Exception;
 
     public abstract RepositoryImpl parseRepository(Reader r) throws Exception;
 

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java?rev=1791891&r1=1791890&r2=1791891&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
Wed Apr 19 09:44:52 2017
@@ -310,6 +310,6 @@ public class ResourceImpl implements Res
 
     public String toString()
     {
-        return getId();
+        return (getId() == null || getId().isEmpty())?getSymbolicName():getId();
     }
 }
\ No newline at end of file

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.java?rev=1791891&r1=1791890&r2=1791891&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.java
Wed Apr 19 09:44:52 2017
@@ -19,6 +19,7 @@
 package org.apache.felix.bundlerepository.impl;
 
 import java.io.IOException;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -48,10 +49,10 @@ public class SpecXMLPullParser
     private static final String REQUIREMENT = "requirement";
     private static final String RESOURCE = "resource";
 
-    public static RepositoryImpl parse(XmlPullParser reader) throws Exception
+    public static RepositoryImpl parse(XmlPullParser reader, String repositoryURI) throws
Exception
     {
         RepositoryImpl repository = new RepositoryImpl();
-
+        repository.setURI(repositoryURI);
         for (int i = 0, ac = reader.getAttributeCount(); i < ac; i++)
         {
             String name = reader.getAttributeName(i);
@@ -72,7 +73,7 @@ public class SpecXMLPullParser
             }
             else if (RESOURCE.equals(element))
             {
-                Resource resource = parseResource(reader);
+                Resource resource = parseResource(reader, repositoryURI);
                 repository.addResource(resource);
             }
             else
@@ -85,7 +86,7 @@ public class SpecXMLPullParser
         return repository;
     }
 
-    private static Resource parseResource(XmlPullParser reader) throws Exception
+    private static Resource parseResource(XmlPullParser reader, String repositoryURI) throws
Exception
     {
         ResourceImpl resource = new ResourceImpl();
         try
@@ -96,7 +97,7 @@ public class SpecXMLPullParser
                 String element = reader.getName();
                 if (CAPABILITY.equals(element))
                 {
-                    Capability capability = parseCapability(reader, resource);
+                    Capability capability = parseCapability(reader, resource, repositoryURI);
                     if (capability != null)
                         resource.addCapability(capability);
                 }
@@ -122,7 +123,7 @@ public class SpecXMLPullParser
         }
     }
 
-    private static Capability parseCapability(XmlPullParser reader, ResourceImpl resource)
throws Exception
+    private static Capability parseCapability(XmlPullParser reader, ResourceImpl resource,
String repositoryURI) throws Exception
     {
         String namespace = reader.getAttributeValue(null, NAMESPACE);
         if (IdentityNamespace.IDENTITY_NAMESPACE.equals(namespace))
@@ -134,7 +135,7 @@ public class SpecXMLPullParser
         {
             if (resource.getURI() == null)
             {
-                parseContentNamespace(reader, resource);
+                parseContentNamespace(reader, resource, repositoryURI);
                 return null;
             }
             // if the URI is already set, this is a second osgi.content capability.
@@ -188,18 +189,23 @@ public class SpecXMLPullParser
         }
     }
 
-    private static void parseContentNamespace(XmlPullParser reader, ResourceImpl resource)
throws Exception
+    private static void parseContentNamespace(XmlPullParser reader, ResourceImpl resource,
String repositoryURI) throws Exception
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         parseAttributesDirectives(reader, attributes, new HashMap<String, String>(),
CAPABILITY);
-
+        URI repo = URI.create(repositoryURI);
+        
         for (Map.Entry<String, Object> entry : attributes.entrySet())
         {
             if (ContentNamespace.CONTENT_NAMESPACE.equals(entry.getKey()))
                 // TODO we should really check the SHA
                 continue;
-            else if (ContentNamespace.CAPABILITY_URL_ATTRIBUTE.equals(entry.getKey()))
-                resource.put(Resource.URI, entry.getValue());
+            else if (ContentNamespace.CAPABILITY_URL_ATTRIBUTE.equals(entry.getKey())) {
+                String value = (String) entry.getValue();
+                URI uri = URI.create(value); 
+                URI resourceURI = uri.isAbsolute()? uri:URI.create(repo.toString().concat(value));
+                resource.put(Resource.URI, resourceURI);
+            }
             else
                 resource.put(entry.getKey(), entry.getValue());
         }

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java?rev=1791891&r1=1791890&r2=1791891&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
Wed Apr 19 09:44:52 2017
@@ -69,7 +69,7 @@ public class StaxParser extends Reposito
         return false;
     }
 
-    public RepositoryImpl parseRepository(InputStream is) throws Exception
+    public RepositoryImpl parseRepository(InputStream is, String repositoryURI) throws Exception
     {
         XMLStreamReader reader = getFactory().createXMLStreamReader(is);
         int event = reader.nextTag();
@@ -77,7 +77,9 @@ public class StaxParser extends Reposito
         {
             throw new Exception("Expected element 'repository' at the root of the document");
         }
-        return parseRepository(reader);
+        RepositoryImpl repo = parseRepository(reader);
+        repo.setURI(repositoryURI);
+        return repo;
     }
 
     public RepositoryImpl parseRepository(Reader r) throws Exception

Modified: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryXMLTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryXMLTest.java?rev=1791891&r1=1791890&r2=1791891&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryXMLTest.java
(original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryXMLTest.java
Wed Apr 19 09:44:52 2017
@@ -29,6 +29,7 @@ import java.util.Map.Entry;
 
 import junit.framework.TestCase;
 
+import org.apache.felix.bundlerepository.Resolver;
 import org.apache.felix.utils.log.Logger;
 import org.mockito.Mockito;
 import org.osgi.framework.Bundle;
@@ -42,30 +43,79 @@ import org.osgi.resource.Resource;
 import org.osgi.service.repository.ContentNamespace;
 import org.osgi.service.repository.Repository;
 
-public class OSGiRepositoryXMLTest extends TestCase
-{
-    public void testIdentityCapability() throws Exception
-    {
+public class OSGiRepositoryXMLTest extends TestCase {
+    public void testIdentityCapability() throws Exception {
         RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
         URL url = getClass().getResource("/spec_repository.xml");
         repoAdmin.addRepository(url);
 
         Repository repo = new OSGiRepositoryImpl(repoAdmin);
-        Requirement req = new OSGiRequirementImpl("osgi.identity", "(osgi.identity=cdi-subsystem)");
+        Requirement req = new OSGiRequirementImpl("osgi.identity",
+                "(osgi.identity=cdi-subsystem)");
 
-        Map<Requirement, Collection<Capability>> result = repo.findProviders(Collections.singleton(req));
+        Map<Requirement, Collection<Capability>> result = repo
+                .findProviders(Collections.singleton(req));
         assertEquals(1, result.size());
         Collection<Capability> caps = result.values().iterator().next();
         assertEquals(1, caps.size());
         Capability cap = caps.iterator().next();
 
-        assertEquals("cdi-subsystem", cap.getAttributes().get(IdentityNamespace.IDENTITY_NAMESPACE));
-        assertEquals(Version.parseVersion("0.5.0"), cap.getAttributes().get(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE));
-        assertEquals("osgi.subsystem.feature", cap.getAttributes().get(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE));
+        assertEquals("cdi-subsystem",
+                cap.getAttributes().get(IdentityNamespace.IDENTITY_NAMESPACE));
+        assertEquals(Version.parseVersion("0.5.0"), cap.getAttributes()
+                .get(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE));
+        assertEquals("osgi.subsystem.feature", cap.getAttributes()
+                .get(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE));
+    }
+
+    public void testIdentityCapabilityWithRelativePath() throws Exception {
+        URL url = getClass().getResource("/spec_repository.xml");
+        RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
+        repoAdmin.addRepository(url);
+
+        Resolver resolver = repoAdmin.resolver();
+
+        org.apache.felix.bundlerepository.Resource[] discoverResources = repoAdmin
+                .discoverResources(
+                        "(symbolicname=org.apache.felix.bundlerepository.test_file_6*)");
+        assertNotNull(discoverResources);
+        assertEquals(1, discoverResources.length);
+
+        resolver.add(discoverResources[0]);
+        assertTrue(resolver.resolve());
+
+        org.apache.felix.bundlerepository.Resource[] resources = resolver.getAddedResources();
+        assertNotNull(resources[0]);
+        String repostr = url.toExternalForm().substring(0, url.toExternalForm().lastIndexOf('/')+1);
+        assertEquals(repostr+"repo_files/test_file_6.jar", resources[0].getURI());
+   
     }
 
-    public void testOtherIdentityAttribute() throws Exception
-    {
+    public void testIdentityCapabilityForZipWithRelativePath() throws Exception {
+        URL url = getClass().getResource("/spec_repository.zip");
+        RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
+        repoAdmin.addRepository(url);
+
+        Resolver resolver = repoAdmin.resolver();
+
+        org.apache.felix.bundlerepository.Resource[] discoverResources = repoAdmin
+                .discoverResources(
+                        "(symbolicname=org.apache.felix.bundlerepository.test_file_6*)");
+        assertNotNull(discoverResources);
+        assertEquals(1, discoverResources.length);
+
+        resolver.add(discoverResources[0]);
+        assertTrue(resolver.resolve());
+
+        org.apache.felix.bundlerepository.Resource[] resources = resolver.getAddedResources();
+        assertNotNull(resources[0]);
+        String repostr = url.toExternalForm().substring(0, url.toExternalForm().lastIndexOf('/')+1);
+        assertEquals("jar:"+ repostr+"spec_repository.zip!/repo_files/test_file_6.jar", resources[0].getURI());
+   
+    }
+
+
+    public void testOtherIdentityAttribute() throws Exception {
         RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
         URL url = getClass().getResource("/spec_repository.xml");
         repoAdmin.addRepository(url);
@@ -74,17 +124,17 @@ public class OSGiRepositoryXMLTest exten
         Requirement req = new OSGiRequirementImpl("osgi.identity",
                 "(license=http://www.opensource.org/licenses/mytestlicense)");
 
-        Map<Requirement, Collection<Capability>> result = repo.findProviders(Collections.singleton(req));
+        Map<Requirement, Collection<Capability>> result = repo
+                .findProviders(Collections.singleton(req));
         assertEquals(1, result.size());
         Collection<Capability> caps = result.values().iterator().next();
         assertEquals(1, caps.size());
         Capability cap = caps.iterator().next();
-        assertEquals("org.apache.felix.bundlerepository.test_file_3", cap.getAttributes().
-                get(IdentityNamespace.IDENTITY_NAMESPACE));
+        assertEquals("org.apache.felix.bundlerepository.test_file_3",
+                cap.getAttributes().get(IdentityNamespace.IDENTITY_NAMESPACE));
     }
 
-    public void testContentCapability() throws Exception
-    {
+    public void testContentCapability() throws Exception {
         RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
         URL url = getClass().getResource("/spec_repository.xml");
         repoAdmin.addRepository(url);
@@ -92,7 +142,8 @@ public class OSGiRepositoryXMLTest exten
         Repository repo = new OSGiRepositoryImpl(repoAdmin);
         Requirement req = new OSGiRequirementImpl("foo", "(bar=toast)");
 
-        Map<Requirement, Collection<Capability>> result = repo.findProviders(Collections.singleton(req));
+        Map<Requirement, Collection<Capability>> result = repo
+                .findProviders(Collections.singleton(req));
         assertEquals(1, result.size());
         Collection<Capability> caps = result.values().iterator().next();
         assertEquals(1, caps.size());
@@ -101,41 +152,53 @@ public class OSGiRepositoryXMLTest exten
         assertEquals("foo", cap.getNamespace());
         assertEquals(0, cap.getDirectives().size());
         assertEquals(1, cap.getAttributes().size());
-        Entry<String, Object> fooCap = cap.getAttributes().entrySet().iterator().next();
+        Entry<String, Object> fooCap = cap.getAttributes().entrySet().iterator()
+                .next();
         assertEquals("bar", fooCap.getKey());
         assertEquals("toast", fooCap.getValue());
 
         Resource res = cap.getResource();
-        List<Capability> idCaps = res.getCapabilities(IdentityNamespace.IDENTITY_NAMESPACE);
+        List<Capability> idCaps = res
+                .getCapabilities(IdentityNamespace.IDENTITY_NAMESPACE);
         assertEquals(1, idCaps.size());
         Capability idCap = idCaps.iterator().next();
 
-        assertEquals("org.apache.felix.bundlerepository.test_file_3", idCap.getAttributes().get(IdentityNamespace.IDENTITY_NAMESPACE));
-        assertEquals(Version.parseVersion("1.2.3.something"), idCap.getAttributes().get(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE));
-        assertEquals("osgi.bundle", idCap.getAttributes().get(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE));
+        assertEquals("org.apache.felix.bundlerepository.test_file_3", idCap
+                .getAttributes().get(IdentityNamespace.IDENTITY_NAMESPACE));
+        assertEquals(Version.parseVersion("1.2.3.something"),
+                idCap.getAttributes()
+                        .get(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE));
+        assertEquals("osgi.bundle", idCap.getAttributes()
+                .get(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE));
 
-        List<Capability> contentCaps = res.getCapabilities(ContentNamespace.CONTENT_NAMESPACE);
+        List<Capability> contentCaps = res
+                .getCapabilities(ContentNamespace.CONTENT_NAMESPACE);
         assertEquals(1, contentCaps.size());
         Capability contentCap = contentCaps.iterator().next();
 
-        assertEquals("b5d4045c3f466fa91fe2cc6abe79232a1a57cdf104f7a26e716e0a1e2789df78",
-            contentCap.getAttributes().get(ContentNamespace.CONTENT_NAMESPACE));
-        assertEquals(new Long(3), contentCap.getAttributes().get(ContentNamespace.CAPABILITY_SIZE_ATTRIBUTE));
-        assertEquals("application/vnd.osgi.bundle", contentCap.getAttributes().get(ContentNamespace.CAPABILITY_MIME_ATTRIBUTE));
+        assertEquals(
+                "b5d4045c3f466fa91fe2cc6abe79232a1a57cdf104f7a26e716e0a1e2789df78",
+                contentCap.getAttributes()
+                        .get(ContentNamespace.CONTENT_NAMESPACE));
+        assertEquals(new Long(3), contentCap.getAttributes()
+                .get(ContentNamespace.CAPABILITY_SIZE_ATTRIBUTE));
+        assertEquals("application/vnd.osgi.bundle", contentCap.getAttributes()
+                .get(ContentNamespace.CAPABILITY_MIME_ATTRIBUTE));
 
         URL fileURL = getClass().getResource("/repo_files/test_file_3.jar");
         byte[] expectedBytes = Streams.suck(fileURL.openStream());
 
-        String resourceURL = (String) contentCap.getAttributes().get(ContentNamespace.CAPABILITY_URL_ATTRIBUTE);
+        String resourceURL = (String) contentCap.getAttributes()
+                .get(ContentNamespace.CAPABILITY_URL_ATTRIBUTE);
         byte[] actualBytes = Streams.suck(new URL(resourceURL).openStream());
         assertEquals(3L, actualBytes.length);
         assertTrue(Arrays.equals(expectedBytes, actualBytes));
     }
 
-    private RepositoryAdminImpl createRepositoryAdmin() throws Exception
-    {
+    private RepositoryAdminImpl createRepositoryAdmin() throws Exception {
         Bundle sysBundle = Mockito.mock(Bundle.class);
-        Mockito.when(sysBundle.getHeaders()).thenReturn(new Hashtable<String, String>());
+        Mockito.when(sysBundle.getHeaders())
+                .thenReturn(new Hashtable<String, String>());
         BundleRevision br = Mockito.mock(BundleRevision.class);
         Mockito.when(sysBundle.adapt(BundleRevision.class)).thenReturn(br);
 
@@ -146,5 +209,4 @@ public class OSGiRepositoryXMLTest exten
         return new RepositoryAdminImpl(bc, new Logger(bc));
     }
 
-
 }

Added: felix/trunk/bundlerepository/src/test/resources/spec_repository.zip
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/resources/spec_repository.zip?rev=1791891&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/trunk/bundlerepository/src/test/resources/spec_repository.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message