felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1685088 - in /felix/trunk: ./ resolver/src/test/java/org/apache/felix/resolver/test/ resolver/src/test/java/org/apache/felix/resolver/test/util/
Date Fri, 12 Jun 2015 13:29:18 GMT
Author: gnodet
Date: Fri Jun 12 13:29:17 2015
New Revision: 1685088

URL: http://svn.apache.org/r1685088
Log:
[FELIX-4914] Move test utility classes to a separate package

Added:
    felix/trunk/.DS_Store
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleCapability.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleRequirement.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleRequirement.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CandidateComparator.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CandidateComparator.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CapabilitySet.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CapabilitySet.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ClauseParser.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ClauseParser.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericCapability.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericRequirement.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericRequirement.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IdentityCapability.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IdentityCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IterativeResolver.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IterativeResolver.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/JsonReader.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/JsonReader.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageCapability.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageRequirement.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageRequirement.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResolveContextImpl.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolveContextImpl.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResourceImpl.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResourceImpl.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/SimpleFilter.java
      - copied, changed from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/SimpleFilter.java
Removed:
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleRequirement.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CandidateComparator.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CapabilitySet.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ClauseParser.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericRequirement.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IdentityCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IterativeResolver.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/JsonReader.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageCapability.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageRequirement.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolveContextImpl.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResourceImpl.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/SimpleFilter.java
Modified:
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BigResolutionTest.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/Main.java
    felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolverTest.java

Added: felix/trunk/.DS_Store
URL: http://svn.apache.org/viewvc/felix/trunk/.DS_Store?rev=1685088&view=auto
==============================================================================
Binary files felix/trunk/.DS_Store (added) and felix/trunk/.DS_Store Fri Jun 12 13:29:17 2015
differ

Modified: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BigResolutionTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BigResolutionTest.java?rev=1685088&r1=1685087&r2=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BigResolutionTest.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BigResolutionTest.java
Fri Jun 12 13:29:17 2015
@@ -31,6 +31,15 @@ import java.util.Set;
 
 import org.apache.felix.resolver.Logger;
 import org.apache.felix.resolver.ResolverImpl;
+import org.apache.felix.resolver.test.util.CandidateComparator;
+import org.apache.felix.resolver.test.util.CapabilitySet;
+import org.apache.felix.resolver.test.util.ClauseParser;
+import org.apache.felix.resolver.test.util.GenericCapability;
+import org.apache.felix.resolver.test.util.GenericRequirement;
+import org.apache.felix.resolver.test.util.IterativeResolver;
+import org.apache.felix.resolver.test.util.JsonReader;
+import org.apache.felix.resolver.test.util.ResourceImpl;
+import org.apache.felix.resolver.test.util.SimpleFilter;
 import org.apache.felix.utils.version.VersionRange;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -193,18 +202,24 @@ public class BigResolutionTest {
     }
 
     @SuppressWarnings("unchecked")
-    private Resource parseResource(Object resource) throws BundleException {
+    public static Resource parseResource(Object resource) throws BundleException {
         ResourceImpl res = new ResourceImpl();
-        for (String s : (Collection<String>) ((Map) resource).get("capabilities"))
{
-            parseCapability(res, s);
+        Collection<String> caps = (Collection<String>) ((Map) resource).get("capabilities");
+        if (caps != null) {
+            for (String s : caps) {
+                parseCapability(res, s);
+            }
         }
-        for (String s : (Collection<String>) ((Map) resource).get("requirements"))
{
-            parseRequirement(res, s);
+        Collection<String> reqs = (Collection<String>) ((Map) resource).get("requirements");
+        if (reqs != null) {
+            for (String s : reqs) {
+                parseRequirement(res, s);
+            }
         }
         return res;
     }
 
-    private void parseRequirement(ResourceImpl res, String s) throws BundleException {
+    private static void parseRequirement(ResourceImpl res, String s) throws BundleException
{
         List<ClauseParser.ParsedHeaderClause> clauses = ClauseParser.parseStandardHeader(s);
         normalizeRequirementClauses(clauses);
         for (ClauseParser.ParsedHeaderClause clause : clauses) {
@@ -221,7 +236,7 @@ public class BigResolutionTest {
         }
     }
 
-    private void parseCapability(ResourceImpl res, String s) throws BundleException {
+    private static void parseCapability(ResourceImpl res, String s) throws BundleException
{
         List<ClauseParser.ParsedHeaderClause> clauses = ClauseParser.parseStandardHeader(s);
         normalizeCapabilityClauses(clauses);
         for (ClauseParser.ParsedHeaderClause clause : clauses) {

Modified: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/Main.java
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/Main.java?rev=1685088&r1=1685087&r2=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/Main.java (original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/Main.java Fri Jun 12
13:29:17 2015
@@ -27,6 +27,14 @@ import java.util.Map;
 
 import org.apache.felix.resolver.Logger;
 import org.apache.felix.resolver.ResolverImpl;
+import org.apache.felix.resolver.test.util.BundleCapability;
+import org.apache.felix.resolver.test.util.BundleRequirement;
+import org.apache.felix.resolver.test.util.GenericCapability;
+import org.apache.felix.resolver.test.util.GenericRequirement;
+import org.apache.felix.resolver.test.util.PackageCapability;
+import org.apache.felix.resolver.test.util.PackageRequirement;
+import org.apache.felix.resolver.test.util.ResolveContextImpl;
+import org.apache.felix.resolver.test.util.ResourceImpl;
 import org.osgi.framework.namespace.BundleNamespace;
 import org.osgi.framework.namespace.HostNamespace;
 import org.osgi.framework.namespace.IdentityNamespace;

Modified: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolverTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolverTest.java?rev=1685088&r1=1685087&r2=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolverTest.java (original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolverTest.java Fri
Jun 12 13:29:17 2015
@@ -33,7 +33,14 @@ import java.util.Map;
 
 import org.apache.felix.resolver.Logger;
 import org.apache.felix.resolver.ResolverImpl;
-import org.junit.Ignore;
+import org.apache.felix.resolver.test.util.BundleCapability;
+import org.apache.felix.resolver.test.util.BundleRequirement;
+import org.apache.felix.resolver.test.util.GenericCapability;
+import org.apache.felix.resolver.test.util.GenericRequirement;
+import org.apache.felix.resolver.test.util.PackageCapability;
+import org.apache.felix.resolver.test.util.PackageRequirement;
+import org.apache.felix.resolver.test.util.ResolveContextImpl;
+import org.apache.felix.resolver.test.util.ResourceImpl;
 import org.junit.Test;
 import org.osgi.framework.Constants;
 import org.osgi.framework.namespace.BundleNamespace;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleCapability.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleCapability.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleCapability.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleCapability.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleCapability.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleCapability.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleCapability.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -26,7 +26,7 @@ import org.osgi.framework.namespace.Pack
 import org.osgi.resource.Capability;
 import org.osgi.resource.Resource;
 
-class BundleCapability implements Capability
+public class BundleCapability implements Capability
 {
     private final Resource m_resource;
     private final Map<String, String> m_dirs;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleRequirement.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleRequirement.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleRequirement.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleRequirement.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleRequirement.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/BundleRequirement.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/BundleRequirement.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -26,7 +26,7 @@ import org.osgi.framework.namespace.Pack
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
 
-class BundleRequirement implements Requirement
+public class BundleRequirement implements Requirement
 {
     private final Resource m_resource;
     private final Map<String, String> m_dirs;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CandidateComparator.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CandidateComparator.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CandidateComparator.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CandidateComparator.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CandidateComparator.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CandidateComparator.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CandidateComparator.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.Comparator;
 

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CapabilitySet.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CapabilitySet.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CapabilitySet.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CapabilitySet.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CapabilitySet.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/CapabilitySet.java (original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/CapabilitySet.java
Fri Jun 12 13:29:17 2015
@@ -16,13 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.lang.reflect.Array;
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ClauseParser.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ClauseParser.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ClauseParser.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ClauseParser.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ClauseParser.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ClauseParser.java (original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ClauseParser.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
@@ -286,7 +286,7 @@ public class ClauseParser {
     }
 
 
-    static class ParsedHeaderClause {
+    public static class ParsedHeaderClause {
         public final List<String> paths = new ArrayList<String>();
         public final Map<String, String> dirs = new LinkedHashMap<String, String>();
         public final Map<String, Object> attrs = new LinkedHashMap<String, Object>();

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericCapability.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericCapability.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericCapability.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericCapability.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericCapability.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericCapability.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericCapability.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -24,7 +24,7 @@ import java.util.Map;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Resource;
 
-class GenericCapability implements Capability
+public class GenericCapability implements Capability
 {
     private final Resource m_resource;
     private final String m_namespace;
@@ -75,4 +75,26 @@ class GenericCapability implements Capab
         return getNamespace() + "; "
             + getAttributes();
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        GenericCapability that = (GenericCapability) o;
+
+        if (!m_attrs.equals(that.m_attrs)) return false;
+        if (!m_dirs.equals(that.m_dirs)) return false;
+        if (!m_namespace.equals(that.m_namespace)) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = m_namespace.hashCode();
+        result = 31 * result + m_dirs.hashCode();
+        result = 31 * result + m_attrs.hashCode();
+        return result;
+    }
 }
\ No newline at end of file

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericRequirement.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericRequirement.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericRequirement.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericRequirement.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericRequirement.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/GenericRequirement.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/GenericRequirement.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -24,7 +24,7 @@ import java.util.Map;
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
 
-class GenericRequirement implements Requirement
+public class GenericRequirement implements Requirement
 {
     private final Resource m_resource;
     private final String m_namespace;
@@ -39,6 +39,20 @@ class GenericRequirement implements Requ
         m_attrs = new HashMap<String, Object>();
     }
 
+    public GenericRequirement(Resource resource, String namespace, Map<String, String>
directives, Map<String, Object> attributes) {
+        this(resource, namespace);
+        if (directives != null) {
+            for (Map.Entry<String, String> entry : directives.entrySet()) {
+                addDirective(entry.getKey(), entry.getValue());
+            }
+        }
+        if (attributes != null) {
+            for (Map.Entry<String, Object> entry : attributes.entrySet()) {
+                addAttribute(entry.getKey(), entry.getValue());
+            }
+        }
+    }
+
     public String getNamespace()
     {
         return m_namespace;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IdentityCapability.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IdentityCapability.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IdentityCapability.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IdentityCapability.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IdentityCapability.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IdentityCapability.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IdentityCapability.java
Fri Jun 12 13:29:17 2015
@@ -16,16 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.HashMap;
 import java.util.Map;
 
+import org.osgi.framework.Version;
 import org.osgi.framework.namespace.IdentityNamespace;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Resource;
 
-class IdentityCapability implements Capability
+public class IdentityCapability implements Capability
 {
     private final Resource m_resource;
     private final Map<String, String> m_dirs;
@@ -38,6 +39,7 @@ class IdentityCapability implements Capa
         m_attrs = new HashMap<String, Object>();
         m_attrs.put(IdentityNamespace.IDENTITY_NAMESPACE, name);
         m_attrs.put(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE, type);
+        m_attrs.put(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE, Version.emptyVersion);
     }
 
     public String getNamespace()

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IterativeResolver.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IterativeResolver.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IterativeResolver.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IterativeResolver.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IterativeResolver.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/IterativeResolver.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/IterativeResolver.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.ArrayList;
 import java.util.Collection;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/JsonReader.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/JsonReader.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/JsonReader.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/JsonReader.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/JsonReader.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/JsonReader.java (original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/JsonReader.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -24,7 +24,6 @@ import java.io.InputStreamReader;
 import java.io.Reader;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
 

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageCapability.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageCapability.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageCapability.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageCapability.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageCapability.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageCapability.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageCapability.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -25,7 +25,7 @@ import org.osgi.framework.namespace.Pack
 import org.osgi.resource.Capability;
 import org.osgi.resource.Resource;
 
-class PackageCapability implements Capability
+public class PackageCapability implements Capability
 {
     private final Resource m_resource;
     private final Map<String, String> m_dirs;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageRequirement.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageRequirement.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageRequirement.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageRequirement.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageRequirement.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/PackageRequirement.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/PackageRequirement.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -25,7 +25,7 @@ import org.osgi.framework.namespace.Pack
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
 
-class PackageRequirement implements Requirement
+public class PackageRequirement implements Requirement
 {
     private final Resource m_resource;
     private final Map<String, String> m_dirs;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResolveContextImpl.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolveContextImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResolveContextImpl.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResolveContextImpl.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolveContextImpl.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResolveContextImpl.java
(original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResolveContextImpl.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -29,7 +29,7 @@ import org.osgi.resource.Wiring;
 import org.osgi.service.resolver.HostedCapability;
 import org.osgi.service.resolver.ResolveContext;
 
-class ResolveContextImpl extends ResolveContext
+public class ResolveContextImpl extends ResolveContext
 {
     private final Map<Resource, Wiring> m_wirings;
     private final Map<Requirement, List<Capability>> m_candMap;

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResourceImpl.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResourceImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResourceImpl.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResourceImpl.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResourceImpl.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/ResourceImpl.java (original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/ResourceImpl.java
Fri Jun 12 13:29:17 2015
@@ -16,10 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
+
+import org.apache.felix.resolver.test.util.IdentityCapability;
 import org.osgi.framework.namespace.IdentityNamespace;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Requirement;
@@ -93,4 +96,16 @@ public class ResourceImpl implements Res
     {
         return getCapabilities(IdentityNamespace.IDENTITY_NAMESPACE).get(0).toString();
     }
+
+    public void addCapabilities(Collection<Capability> caps) {
+        for (Capability cap : caps) {
+            addCapability(cap);
+        }
+    }
+
+    public void addRequirements(Collection<Requirement> reqs) {
+        for (Requirement req : reqs) {
+            addRequirement(req);
+        }
+    }
 }
\ No newline at end of file

Copied: felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/SimpleFilter.java
(from r1685082, felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/SimpleFilter.java)
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/SimpleFilter.java?p2=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/SimpleFilter.java&p1=felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/SimpleFilter.java&r1=1685082&r2=1685088&rev=1685088&view=diff
==============================================================================
--- felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/SimpleFilter.java (original)
+++ felix/trunk/resolver/src/test/java/org/apache/felix/resolver/test/util/SimpleFilter.java
Fri Jun 12 13:29:17 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.resolver.test;
+package org.apache.felix.resolver.test.util;
 
 import java.util.ArrayList;
 import java.util.List;



Mime
View raw message