http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java 
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
deleted file mode 100644
index 31b1e42..0000000
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.qos;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.cxf.dosgi.dsw.Constants;
-import org.apache.cxf.dosgi.dsw.util.OsgiUtils;
-import org.osgi.service.remoteserviceadmin.RemoteConstants;
-
-public final class IntentUtils {
-
-    private IntentUtils() {
-        // never constructed
-    }
-
-    public static String[] mergeArrays(String[] a1, String[] a2) {
-        if (a1 == null) {
-            return a2;
-        }
-        if (a2 == null) {
-            return a1;
-        }
-
-        List<String> list = new ArrayList<String>(a1.length + a2.length);
-        Collections.addAll(list, a1);
-        for (String s : a2) {
-            if (!list.contains(s)) {
-                list.add(s);
-            }
-        }
-
-        return list.toArray(new String[list.size()]);
-    }
-
-    public static Set<String> getRequestedIntents(Map<String, Object> sd) {
-        Collection<String> intents = 
OsgiUtils.getMultiValueProperty(sd.get(RemoteConstants.SERVICE_EXPORTED_INTENTS));
-        Collection<String> intents2
-            = 
OsgiUtils.getMultiValueProperty(sd.get(RemoteConstants.SERVICE_EXPORTED_INTENTS_EXTRA));
-        @SuppressWarnings("deprecation")
-        Collection<String> oldIntents = 
OsgiUtils.getMultiValueProperty(sd.get(Constants.EXPORTED_INTENTS_OLD));
-        Set<String> allIntents = new HashSet<String>();
-        if (intents != null) {
-            allIntents.addAll(parseIntents(intents));
-        }
-        if (intents2 != null) {
-            allIntents.addAll(parseIntents(intents2));
-        }
-        if (oldIntents != null) {
-            allIntents.addAll(parseIntents(oldIntents));
-        }
-
-        return allIntents;
-    }
-
-    private static Collection<String> parseIntents(Collection<String> intents) 
{
-        List<String> parsed = new ArrayList<String>();
-        for (String intent : intents) {
-            parsed.addAll(Arrays.asList(intent.split("[ ]")));
-        }
-        return parsed;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java 
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
deleted file mode 100644
index 9acd0f0..0000000
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.util;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.ExportedPackage;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.remoteserviceadmin.EndpointDescription;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("deprecation")
-public final class OsgiUtils {
-
-    public static final Logger LOG = LoggerFactory.getLogger(OsgiUtils.class);
-
-    private OsgiUtils() {
-    }
-
-    public static boolean getBooleanProperty(Map<String, Object> sd, String 
name) {
-        return toBoolean(sd.get(name));
-    }
-
-    public static boolean toBoolean(Object value) {
-        return value instanceof Boolean && (Boolean) value
-            || value instanceof String && Boolean.parseBoolean((String)value);
-    }
-
-    @SuppressWarnings("unchecked")
-    public static Collection<String> getMultiValueProperty(Object property) {
-        if (property == null) {
-            return null;
-        } else if (property instanceof Collection) {
-            return (Collection<String>)property;
-        } else if (property instanceof String[]) {
-            return Arrays.asList((String[])property);
-        } else {
-            return Collections.singleton(property.toString());
-        }
-    }
-
-    public static String getProperty(EndpointDescription endpoint, String 
name) {
-        return getProperty(endpoint.getProperties(), name);
-    }
-
-    public static String getProperty(Map<String, Object> dict, String name) {
-        Object value = dict.get(name);
-        return value instanceof String ? (String) value : null;
-    }
-
-    public static String getFirstNonEmptyStringProperty(Map<String, Object> 
dict, String ... keys) {
-        for (String key : keys) {
-            String value = getProperty(dict, key);
-            if (value != null) {
-                return value;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Tries to retrieve the version of iClass via the PackageAdmin.
-     *
-     * @param iClass tThe interface for which the version should be found
-     * @param bc any valid BundleContext
-     * @return the version of the interface or "0.0.0" if no version 
information could be found or an error
-     *         occurred during the retrieval
-     */
-    public static String getVersion(Class<?> iClass, BundleContext bc) {
-        ServiceReference<PackageAdmin> paRef = 
bc.getServiceReference(PackageAdmin.class);
-        if (paRef != null) {
-            PackageAdmin pa = bc.getService(paRef);
-            try {
-                Bundle b = pa.getBundle(iClass);
-                if (b == null) {
-                    LOG.info("Unable to find interface version for interface " 
+ iClass.getName()
-                            + ". Falling back to 0.0.0");
-                    return "0.0.0";
-                }
-                LOG.debug("Interface source bundle: {}", b.getSymbolicName());
-
-                ExportedPackage[] ep = pa.getExportedPackages(b);
-                LOG.debug("Exported Packages of the source bundle: {}", 
(Object)ep);
-
-                String pack = iClass.getPackage().getName();
-                LOG.debug("Looking for Package: {}", pack);
-                if (ep != null) {
-                    for (ExportedPackage p : ep) {
-                        if (p != null
-                            && pack.equals(p.getName())) {
-                            LOG.debug("found package -> Version: {}", 
p.getVersion());
-                            return p.getVersion().toString();
-                        }
-                    }
-                }
-            } finally {
-                if (pa != null) {
-                    bc.ungetService(paRef);
-                }
-            }
-        } else {
-            LOG.error("Was unable to obtain the package admin service -> can't 
resolve interface versions");
-        }
-
-        LOG.info("Unable to find interface version for interface " + 
iClass.getName()
-                 + ". Falling back to 0.0.0");
-        return "0.0.0";
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/StringPlus.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/StringPlus.java 
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/StringPlus.java
deleted file mode 100644
index dbb4cda..0000000
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/StringPlus.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public final class StringPlus {
-
-    private static final Logger LOG = 
LoggerFactory.getLogger(StringPlus.class);
-
-    private StringPlus() {
-        // never constructed
-    }
-
-    @SuppressWarnings("rawtypes")
-    public static String[] normalize(Object object) {
-        if (object instanceof String) {
-            String s = (String)object;
-            String[] values = s.split(",");
-            List<String> list = new ArrayList<String>();
-            for (String val : values) {
-                String actualValue = val.trim();
-                if (!actualValue.isEmpty()) {
-                    list.add(actualValue);
-                }
-            }
-            return list.toArray(new String[list.size()]);
-        }
-
-        if (object instanceof String[]) {
-            return (String[])object;
-        }
-        
-        if (object instanceof Collection) {
-            Collection col = (Collection)object;
-            List<String> ar = new ArrayList<String>(col.size());
-            for (Object o : col) {
-                if (o instanceof String) {
-                    String s = (String)o;
-                    ar.add(s);
-                } else {
-                    LOG.warn("stringPlus contained non string element in list! 
Element was skipped");
-                }
-            }
-            return ar.toArray(new String[ar.size()]);
-        }
-
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/main/resources/service-decoration.xsd
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/resources/service-decoration.xsd 
b/dsw/cxf-dsw/src/main/resources/service-decoration.xsd
deleted file mode 100644
index 66e8d30..0000000
--- a/dsw/cxf-dsw/src/main/resources/service-decoration.xsd
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<schema targetNamespace="http://cxf.apache.org/xmlns/service-decoration/1.0.0"; 
xmlns="http://www.w3.org/2001/XMLSchema"; 
xmlns:tns="http://cxf.apache.org/xmlns/service-decoration/1.0.0";>
-    <element name="service-decorations" 
type="tns:ServiceDecorationsType"></element>
-
-    <complexType name="ServiceDecorationsType">
-        <sequence>
-            <element maxOccurs="unbounded" minOccurs="0"
-                ref="tns:service-decoration">
-            </element>
-        </sequence>
-    </complexType>
-
-    <complexType name="ServiceDecorationType">
-        <sequence>
-            <element maxOccurs="unbounded" minOccurs="0"
-                ref="tns:match">
-            </element>
-        </sequence>
-    </complexType>
-
-    <complexType name="MatchType">
-        <sequence>
-            <element maxOccurs="unbounded" minOccurs="0"
-                ref="tns:match-property">
-            </element>
-            <element maxOccurs="unbounded" minOccurs="0"
-                ref="tns:add-property">
-            </element>
-        </sequence>
-        <attribute name="interface" type="string"></attribute>
-    </complexType>
-
-    <complexType name="MatchPropertyType">
-        <attribute name="name" type="string"></attribute>
-        <attribute name="value" type="string"></attribute>
-    </complexType>
-
-    <complexType name="AddPropertyType">
-        <attribute name="name" type="string"></attribute>
-        <attribute name="value" type="string"></attribute>
-        <attribute name="type" type="string"></attribute>
-    </complexType>
-    <element name="service-decoration"
-        type="tns:ServiceDecorationType">
-    </element>
-    <element name="match" type="tns:MatchType"></element>
-    <element name="match-property" type="tns:MatchPropertyType"></element>
-    <element name="add-property" type="tns:AddPropertyType"></element>
-</schema>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/ActivatorTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/ActivatorTest.java 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/ActivatorTest.java
deleted file mode 100644
index 65e93bc..0000000
--- a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/ActivatorTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import junit.framework.TestCase;
-
-import org.apache.cxf.dosgi.dsw.api.DistributionProvider;
-import org.easymock.EasyMock;
-import org.easymock.IMocksControl;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.ServiceRegistration;
-
-public class ActivatorTest extends TestCase {
-
-    private BundleContext getMockBundleContext(IMocksControl control) {
-        Bundle b = control.createMock(Bundle.class);
-        Dictionary<String, String> ht = new Hashtable<String, String>();
-        EasyMock.expect(b.getHeaders()).andReturn(ht).anyTimes();
-        BundleContext bc = control.createMock(BundleContext.class);
-
-        EasyMock.expect(b.getBundleContext()).andReturn(bc).anyTimes();
-        EasyMock.expect(bc.getBundle()).andReturn(b).anyTimes();
-        return bc;
-    }
-
-    @SuppressWarnings({
-     "rawtypes", "unchecked"
-    })
-    public void testCreateAndShutdownRemoteServiceAdminService() throws 
Exception {
-        IMocksControl control = EasyMock.createNiceControl();
-        BundleContext bc = getMockBundleContext(control);
-        Filter filter = control.createMock(Filter.class);
-        
EasyMock.expect(bc.createFilter(EasyMock.<String>anyObject())).andReturn(filter);
-        EasyMock.expectLastCall().atLeastOnce();
-        ServiceRegistration sr = control.createMock(ServiceRegistration.class);
-        
EasyMock.expect(bc.registerService(EasyMock.eq(DistributionProvider.class.getName()),
-                                           EasyMock.anyObject(), 
(Dictionary<String, String>)EasyMock.anyObject()))
-                                           .andReturn(sr).atLeastOnce();
-
-        control.replay();
-        Activator a = new Activator();
-        a.start(bc);
-        control.verify();
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java
deleted file mode 100644
index b81bf3e..0000000
--- a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw;
-
-public final class TestUtils {
-
-//    private TestUtils() {
-//    }
-//
-//    public static ServiceEndpointDescription 
mockServiceDescription(String... interfaceNames) {
-//        List<String> iList = new ArrayList<String>();
-//        for (String iName : interfaceNames) {
-//            iList.add(iName);
-//        }
-//
-//        ServiceEndpointDescription sd = 
EasyMock.createNiceMock(ServiceEndpointDescription.class);
-//        sd.getProvidedInterfaces();
-//        EasyMock.expectLastCall().andReturn(iList);
-//        return sd;
-//    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java
deleted file mode 100644
index 270c7fa..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.decorator;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.List;
-
-import javax.xml.bind.JAXBException;
-
-import org.apache.cxf.xmlns.service_decoration._1_0.AddPropertyType;
-import org.apache.cxf.xmlns.service_decoration._1_0.MatchPropertyType;
-import org.apache.cxf.xmlns.service_decoration._1_0.MatchType;
-import org.apache.cxf.xmlns.service_decoration._1_0.ServiceDecorationType;
-import org.junit.Assert;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class DecorationParserTest {
-
-    @Test
-    public void testGetDecoratorForSD() throws JAXBException, IOException {
-        URL resource = getClass().getResource("/test-resources/sd.xml");
-        List<ServiceDecorationType> elements = new 
DecorationParser().getDecorations(resource);
-        assertEquals(1, elements.size());
-        ServiceDecorationType decoration = elements.get(0);
-        assertEquals(1, decoration.getMatch().size());
-        MatchType match = decoration.getMatch().get(0);
-        assertEquals("org.acme.foo.*", match.getInterface());
-        assertEquals(1, match.getMatchProperty().size());
-        MatchPropertyType matchProp = match.getMatchProperty().get(0);
-        assertEquals("test.prop", matchProp.getName());
-        assertEquals("xyz", matchProp.getValue());
-        assertEquals(1, match.getAddProperty().size());
-        AddPropertyType addProp = match.getAddProperty().get(0);
-        assertEquals("test.too", addProp.getName());
-        assertEquals("ahaha", addProp.getValue());
-        assertEquals("java.lang.String", addProp.getType());
-    }
-
-    @Test
-    public void testGetDecorationForNull() throws JAXBException, IOException {
-        List<ServiceDecorationType> elements = new 
DecorationParser().getDecorations(null);
-        Assert.assertEquals(0, elements.size());
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRuleTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRuleTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRuleTest.java
deleted file mode 100644
index c66642b..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRuleTest.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.decorator;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-
-@SuppressWarnings("rawtypes")
-public class InterfaceRuleTest extends TestCase {
-
-    public void testDUMMY() {
-        assertTrue(true);
-    }
-
-    public void testInterfaceRuleGetBundle() {
-        Bundle b = EasyMock.createMock(Bundle.class);
-        EasyMock.replay(b);
-        InterfaceRule ir = new InterfaceRule(b, "org.apache.Foo");
-        assertSame(b, ir.getBundle());
-    }
-
-    public void testInterfaceRule1() {
-        InterfaceRule ir = new InterfaceRule(null, "org.apache.Foo");
-        ir.addProperty("x", "y", String.class.getName());
-
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"a.b.C", 
"org.apache.Foo"});
-        ServiceReference sref = mockServiceReference(serviceProps);
-
-        Map<String, Object> m = new HashMap<String, Object>();
-        m.put("a", "b");
-        ir.apply(sref, m);
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("a", "b");
-        expected.put("x", "y");
-        assertEquals(expected, m);
-    }
-
-    public void testInterfaceRule2() {
-        InterfaceRule ir = new InterfaceRule(null, "org.apache.F(.*)");
-        ir.addPropMatch("boo", "baah");
-        ir.addProperty("x", "1", Integer.class.getName());
-        ir.addProperty("aaa.bbb", "true", Boolean.class.getName());
-
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put("boo", "baah");
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"a.b.C", 
"org.apache.Foo"});
-        ServiceReference sref = mockServiceReference(serviceProps);
-
-        Map<String, Object> m = new HashMap<String, Object>();
-        ir.apply(sref, m);
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("x", 1);
-        expected.put("aaa.bbb", Boolean.TRUE);
-        assertEquals(expected, m);
-    }
-
-    public void testInterfaceRule3() {
-        InterfaceRule ir = new InterfaceRule(null, "org.apache.F(.*)");
-        ir.addProperty("x", "y", String.class.getName());
-
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put("boo", "baah");
-        serviceProps.put(Constants.OBJECTCLASS, new String[] 
{"org.apache.Boo"});
-        ServiceReference sref = mockServiceReference(serviceProps);
-
-        Map<String, Object> m = new HashMap<String, Object>();
-        ir.apply(sref, m);
-        assertEquals(0, m.size());
-    }
-
-    public void testInterfaceRule4() {
-        InterfaceRule ir = new InterfaceRule(null, "org.apache.F(.*)");
-        ir.addPropMatch("boo", "baah");
-        ir.addProperty("x", "y", String.class.getName());
-
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] 
{"org.apache.Foo"});
-        ServiceReference sref = mockServiceReference(serviceProps);
-
-        Map<String, Object> m = new HashMap<String, Object>();
-        ir.apply(sref, m);
-        assertEquals(0, m.size());
-    }
-
-    public void testInterfaceRule5() {
-        InterfaceRule ir = new InterfaceRule(null, "org.apache.Foo");
-        ir.addPropMatch("test.int", "42");
-        ir.addProperty("x", "1", Long.class.getName());
-
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put("test.int", 42);
-        serviceProps.put(Constants.OBJECTCLASS, new String[] 
{"org.apache.Foo"});
-        ServiceReference sref = mockServiceReference(serviceProps);
-
-        Map<String, Object> m = new HashMap<String, Object>();
-        m.put("x", "foo");
-        m.put("aaa.bbb", Boolean.TRUE);
-        ir.apply(sref, m);
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("x", 1L);
-        expected.put("aaa.bbb", Boolean.TRUE);
-        assertEquals(expected, m);
-    }
-
-    public void testInterfaceRule6() {
-        InterfaceRule ir = new InterfaceRule(null, "org.apache.Foo");
-        ir.addPropMatch("test.int", "42");
-        ir.addProperty("x", "1", Long.class.getName());
-
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put("test.int", 51);
-        serviceProps.put(Constants.OBJECTCLASS, new String[] 
{"org.apache.Foo"});
-        ServiceReference sref = mockServiceReference(serviceProps);
-
-        Map<String, Object> m = new HashMap<String, Object>();
-        m.put("x", "foo");
-        m.put("aaa.bbb", Boolean.TRUE);
-        ir.apply(sref, m);
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("x", "foo");
-        expected.put("aaa.bbb", Boolean.TRUE);
-        assertEquals(expected, m);
-    }
-
-    private ServiceReference mockServiceReference(final Map<String, Object> 
serviceProps) {
-        ServiceReference sref = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sref.getProperty((String) 
EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
-            public Object answer() throws Throwable {
-                return serviceProps.get(EasyMock.getCurrentArguments()[0]);
-            }
-        }).anyTimes();
-        EasyMock.expect(sref.getPropertyKeys())
-            .andReturn(serviceProps.keySet().toArray(new String[] 
{})).anyTimes();
-
-        EasyMock.replay(sref);
-        return sref;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java
deleted file mode 100644
index 1ca33fc..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.decorator;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.easymock.EasyMock;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-
-import static org.junit.Assert.assertEquals;
-
-public class ServiceDecoratorBundleListenerTest {
-
-    @Test
-    public void testBundleListener() {
-        BundleContext bc = EasyMock.createMock(BundleContext.class);
-        EasyMock.replay(bc);
-
-        final List<String> called = new ArrayList<String>();
-        ServiceDecoratorImpl serviceDecorator = new ServiceDecoratorImpl() {
-            @Override
-            void addDecorations(Bundle bundle) {
-                called.add("addDecorations");
-            }
-
-            @Override
-            void removeDecorations(Bundle bundle) {
-                called.add("removeDecorations");
-            }
-        };
-
-        Bundle b = EasyMock.createMock(Bundle.class);
-        EasyMock.replay(b);
-        
-        ServiceDecoratorBundleListener listener = new 
ServiceDecoratorBundleListener(serviceDecorator);
-
-        assertEquals("Precondition failed", 0, called.size());
-        listener.bundleChanged(new BundleEvent(BundleEvent.INSTALLED, b));
-        assertEquals(0, called.size());
-
-        listener.bundleChanged(new BundleEvent(BundleEvent.STARTED, b));
-        assertEquals(Arrays.asList("addDecorations"), called);
-
-        listener.bundleChanged(new BundleEvent(BundleEvent.STOPPING, b));
-        assertEquals(Arrays.asList("addDecorations", "removeDecorations"), 
called);
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java
deleted file mode 100644
index 400d793..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.decorator;
-
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-import org.junit.Assert;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-
-public class ServiceDecoratorImplTest extends TestCase {
-    private static final Map<String, Object> EMPTY = new HashMap<String, 
Object>();
-    private static final URL RES_SD = getResource("/test-resources/sd.xml");
-    private static final URL RES_SD1 = getResource("/test-resources/sd1.xml");
-    private static final URL RES_SD2 = getResource("/test-resources/sd2.xml");
-    private static final URL RES_SD0 = getResource("/test-resources/sd0.xml");
-    private static final URL RES_SD_1 = 
getResource("/test-resources/sd-1.xml");
-
-    @SuppressWarnings("rawtypes")
-    public void testAddRemoveDecorations() {
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] 
{"org.acme.foo.Bar"});
-        serviceProps.put("test.prop", "xyz");
-
-        Bundle b = createBundleContaining(RES_SD);
-        ServiceDecoratorImpl sd = new ServiceDecoratorImpl();
-        assertEquals("Precondition failed", 0, sd.decorations.size());
-        sd.addDecorations(b);
-        assertEquals(1, sd.decorations.size());
-
-        Map<String, Object> target = new HashMap<String, Object>();
-        ServiceReference sref = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sref.getProperty((String) 
EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
-            public Object answer() throws Throwable {
-                return serviceProps.get(EasyMock.getCurrentArguments()[0]);
-            }
-        }).anyTimes();
-        EasyMock.replay(sref);
-        sd.decorate(sref, target);
-
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("test.too", "ahaha");
-        assertEquals(expected, target);
-
-        // remove it again
-        sd.removeDecorations(b);
-        assertEquals(0, sd.decorations.size());
-        Map<String, Object> target2 = new HashMap<String, Object>();
-        sd.decorate(sref, target2);
-        assertEquals(EMPTY, target2);
-    }
-
-    public void testAddDecorations() {
-        final Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] 
{"org.acme.foo.Bar"});
-        serviceProps.put("test.prop", "xyz");
-
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("test.too", "ahaha");
-        assertDecorate(serviceProps, expected, RES_SD);
-    }
-
-    public void testAddDecorations1() {
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.test.A"});
-
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("A", "B");
-        expected.put("C", 2);
-        assertDecorate(serviceProps, expected, RES_SD1, RES_SD2);
-    }
-
-    public void testAddDecorations2() {
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.test.D"});
-
-        assertDecorate(serviceProps, EMPTY, RES_SD1, RES_SD2);
-    }
-
-    public void testAddDecorations3() {
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.test.B"});
-        serviceProps.put("x", "y");
-
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("bool", Boolean.TRUE);
-        assertDecorate(serviceProps, expected, RES_SD1, RES_SD2);
-    }
-
-    public void testAddDecorations4() {
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.test.C"});
-        serviceProps.put("x", "z");
-
-        Map<String, Object> expected = new HashMap<String, Object>();
-        expected.put("bool", Boolean.FALSE);
-        assertDecorate(serviceProps, expected, RES_SD1, RES_SD2);
-    }
-
-    public void testAddDecorations5() {
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.test.C"});
-        serviceProps.put("x", "x");
-
-        assertDecorate(serviceProps, EMPTY, RES_SD1, RES_SD2);
-    }
-
-    public void testAddDecorations6() {
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.test.D"});
-
-        assertDecorate(serviceProps, EMPTY, RES_SD0);
-    }
-
-    public void testAddDecorations7() {
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.test.D"});
-
-        assertDecorate(serviceProps, EMPTY, RES_SD_1);
-    }
-    
-    private void assertDecorate(final Map<String, Object> serviceProps, 
-                                Map<String, Object> expected, URL ... 
resources) {
-        Map<String, Object> actual = testDecorate(serviceProps, resources);
-        assertEquals(expected, actual);
-    }
-
-    @SuppressWarnings("rawtypes")
-    private Map<String, Object> testDecorate(final Map<String, Object> 
serviceProps, URL ... resources) {
-        Bundle b = createBundleContaining(resources);
-
-        ServiceDecoratorImpl sd = new ServiceDecoratorImpl();
-        sd.addDecorations(b);
-
-        Map<String, Object> target = new HashMap<String, Object>();
-        ServiceReference sref = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sref.getProperty((String) 
EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
-            public Object answer() throws Throwable {
-                return serviceProps.get(EasyMock.getCurrentArguments()[0]);
-            }
-        }).anyTimes();
-        EasyMock.replay(sref);
-        sd.decorate(sref, target);
-        return target;
-    }
-
-    private Bundle createBundleContaining(URL... resources) {
-        Bundle b = EasyMock.createMock(Bundle.class);
-        EasyMock.expect(b.findEntries("OSGI-INF/remote-service", "*.xml", 
false)).andReturn(
-            Collections.enumeration(Arrays.asList(resources))).anyTimes();
-        EasyMock.expect(b.getSymbolicName()).andReturn("bundlename");
-        EasyMock.replay(b);
-        return b;
-    }
-
-    private static URL getResource(String path) {
-        URL resource = ServiceDecoratorImplTest.class.getResource(path);
-        Assert.assertNotNull("Resource " + path + " not found!", resource);
-        return resource;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProviderTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProviderTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProviderTest.java
deleted file mode 100644
index 8f58918..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProviderTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.handlers;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cxf.dosgi.dsw.Constants;
-import org.apache.cxf.dosgi.dsw.api.DistributionProvider;
-import org.apache.cxf.dosgi.dsw.qos.DefaultIntentMapFactory;
-import org.apache.cxf.dosgi.dsw.qos.IntentManager;
-import org.apache.cxf.dosgi.dsw.qos.IntentManagerImpl;
-import org.apache.cxf.dosgi.dsw.qos.IntentMap;
-import org.easymock.EasyMock;
-import org.junit.Assert;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.remoteserviceadmin.RemoteConstants;
-
-import static org.junit.Assert.assertTrue;
-
-public class CXFDistributionProviderTest {
-
-    @Test
-    public void testGetDefaultHandlerNoIntents() {
-        DistributionProvider handler = getHandlerWith(null, null);
-        assertTrue(handler instanceof PojoConfigurationTypeHandler);
-    }
-
-    @Test
-    public void testGetJaxrsHandlerNoIntents() {
-        DistributionProvider handler = 
getHandlerWith(Constants.RS_CONFIG_TYPE, null);
-        assertTrue(handler instanceof JaxRSPojoConfigurationTypeHandler);
-    }
-
-    @Test
-    public void testGetJaxrsHandlerHttpIntents() {
-        DistributionProvider handler = 
getHandlerWith(Constants.RS_CONFIG_TYPE, "HTTP");
-        assertTrue(handler instanceof JaxRSPojoConfigurationTypeHandler);
-    }
-
-    @Test
-    public void testJaxrsPropertyIgnored() {
-        DistributionProvider handler = 
getHandlerWith(Constants.RS_CONFIG_TYPE, "SOAP HTTP");
-        assertTrue(handler instanceof PojoConfigurationTypeHandler);
-        assertTrue(!(handler instanceof JaxRSPojoConfigurationTypeHandler));
-    }
-
-    @Test
-    public void testJaxrsPropertyIgnored2() {
-        DistributionProvider handler = 
getHandlerWith(Constants.RS_CONFIG_TYPE, new String[] {"HTTP", "SOAP"});
-        assertTrue(handler instanceof PojoConfigurationTypeHandler);
-        assertTrue(!(handler instanceof JaxRSPojoConfigurationTypeHandler));
-    }
-
-    @Test
-    public void testGetPojoHandler() {
-        DistributionProvider handler = 
getHandlerWith(Constants.WS_CONFIG_TYPE, null);
-        assertTrue(handler instanceof PojoConfigurationTypeHandler);
-    }
-
-    @Test
-    public void testGetWSDLHandler() {
-        DistributionProvider handler = 
getHandlerWith(Constants.WSDL_CONFIG_TYPE, null);
-        assertTrue(handler instanceof WsdlConfigurationTypeHandler);
-    }
-    
-    @Test
-    public void testUnsupportedConfiguration() {
-        DistributionProvider handler = getHandlerWith("notSupportedConfig", 
null);
-        Assert.assertNull(handler);
-    }
-
-    private DistributionProvider getHandlerWith(String configType, Object 
intents) {
-        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
-        EasyMock.replay(bc);
-        Map<String, Object> serviceProps = new HashMap<String, Object>();
-        serviceProps.put(RemoteConstants.SERVICE_EXPORTED_CONFIGS, configType);
-        serviceProps.put(RemoteConstants.SERVICE_EXPORTED_INTENTS, intents);
-        IntentMap intentMap = new IntentMap(new 
DefaultIntentMapFactory().create());
-        IntentManager intentManager = new IntentManagerImpl(intentMap);
-        HttpServiceManager httpServiceManager = new HttpServiceManager(bc, 
null, null);
-        CXFDistributionProvider f = new CXFDistributionProvider(bc, 
intentManager, httpServiceManager);
-        List<String> configurationTypes = 
f.determineConfigurationTypes(serviceProps);
-        return f.getHandler(configurationTypes, serviceProps);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClassUtilsTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClassUtilsTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClassUtilsTest.java
deleted file mode 100644
index a0774be..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClassUtilsTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.handlers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.apache.cxf.dosgi.dsw.util.Provider;
-import org.easymock.EasyMock;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-public class ClassUtilsTest extends TestCase {
-
-    public void testGetInterfaceClass() {
-        assertEquals(String.class,
-                ClassUtils.getInterfaceClass("Hello", "java.lang.String"));
-        assertNull(ClassUtils.getInterfaceClass("Hello", "java.lang.Integer"));
-        assertEquals(List.class, ClassUtils.getInterfaceClass(
-                new ArrayList<String>(), "java.util.List"));
-        assertEquals(Collection.class, ClassUtils.getInterfaceClass(
-                new ArrayList<String>(), "java.util.Collection"));
-    }
-
-    public void testGetInterfaceClassFromSubclass() {
-        assertEquals(Map.class, ClassUtils.getInterfaceClass(
-                new MySubclassFour(), "java.util.Map"));
-        assertNull(ClassUtils.getInterfaceClass(new MySubclassFour(),
-                "java.util.UnknownType"));
-    }
-
-    public void testLoadProvidersAsString() throws Exception {
-        BundleContext bc = mockBundleContext();
-        Map<String, Object> sd = Collections.<String, 
Object>singletonMap("providers", Provider.class.getName());
-        List<Object> providers = ClassUtils.loadProviderClasses(bc, sd, 
"providers");
-        assertEquals(1, providers.size());
-        assertTrue(providers.get(0) instanceof Provider);
-    }
-
-    public void testLoadProvidersAsStringArray() throws Exception {
-        BundleContext bc = mockBundleContext();
-        Map<String, Object> sd = Collections.<String, 
Object>singletonMap("providers",
-                new String[]{Provider.class.getName()});
-        List<Object> providers = ClassUtils.loadProviderClasses(bc, sd, 
"providers");
-        assertEquals(1, providers.size());
-        assertTrue(providers.get(0) instanceof Provider);
-    }
-
-    public void testLoadProvidersAsObject() throws Exception {
-        Map<String, Object> sd = Collections.<String, 
Object>singletonMap("providers", new Provider());
-        List<Object> providers = ClassUtils.loadProviderClasses(null, sd, 
"providers");
-        assertEquals(1, providers.size());
-        assertTrue(providers.get(0) instanceof Provider);
-    }
-
-    public void testLoadProvidersAsObjectArray() throws Exception {
-        Map<String, Object> sd = Collections.<String, 
Object>singletonMap("providers", new Object[]{new Provider()});
-        List<Object> providers = ClassUtils.loadProviderClasses(null, sd, 
"providers");
-        assertEquals(1, providers.size());
-        assertTrue(providers.get(0) instanceof Provider);
-    }
-
-    public void testLoadProvidersAsObjectList() throws Exception {
-        List<Object> list = new LinkedList<Object>();
-        list.add(new Provider());
-        Map<String, Object> sd = Collections.<String, 
Object>singletonMap("providers", list);
-        List<Object> providers = ClassUtils.loadProviderClasses(null, sd, 
"providers");
-        assertEquals(1, providers.size());
-        assertTrue(providers.get(0) instanceof Provider);
-    }
-
-    public void testLoadProvidersAsStringList() throws Exception {
-        List<Object> list = new LinkedList<Object>();
-        list.add(Provider.class.getName());
-        Map<String, Object> sd = Collections.<String, 
Object>singletonMap("providers", list);
-        List<Object> providers = 
ClassUtils.loadProviderClasses(mockBundleContext(), sd, "providers");
-        assertEquals(1, providers.size());
-        assertTrue(providers.get(0) instanceof Provider);
-    }
-
-    private BundleContext mockBundleContext() throws Exception {
-        BundleContext bc = EasyMock.createMock(BundleContext.class);
-        Bundle bundle = EasyMock.createMock(Bundle.class);
-        bc.getBundle();
-        EasyMock.expectLastCall().andReturn(bundle);
-        bundle.loadClass(Provider.class.getName());
-        EasyMock.expectLastCall().andReturn(Provider.class);
-        EasyMock.replay(bc, bundle);
-        return bc;
-    }
-
-    @SuppressWarnings({ "serial", "rawtypes" })
-    private static class MyMapSubclass extends HashMap {
-    }
-
-    @SuppressWarnings("serial")
-    static class MySubclassOne extends MyMapSubclass {
-    }
-
-    @SuppressWarnings("serial")
-    static class MySubclassTwo extends MySubclassOne {
-    }
-
-    @SuppressWarnings("serial")
-    static class MySubclassThree extends MySubclassTwo {
-    }
-
-    @SuppressWarnings("serial")
-    static class MySubclassFour extends MySubclassThree {
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
deleted file mode 100644
index 10fba12..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.handlers;
-
-import java.util.Dictionary;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-import junit.framework.TestCase;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.easymock.Capture;
-import org.easymock.EasyMock;
-import org.easymock.IMocksControl;
-import org.junit.Assert;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.HttpContext;
-import org.osgi.service.http.HttpService;
-import org.osgi.service.http.NamespaceException;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-
-public class HttpServiceManagerTest extends TestCase {
-
-    public void testGetAbsoluteAddress() {
-        IMocksControl c = EasyMock.createControl();
-        BundleContext bundleContext = c.createMock(BundleContext.class);
-        c.replay();
-        HttpServiceManager manager = new HttpServiceManager(bundleContext, 
null, null, null);
-        String localIp = LocalHostUtil.getLocalIp();
-
-        String address1 = manager.getAbsoluteAddress(null, "/myservice");
-        assertEquals("http://"; + localIp + ":8181/cxf/myservice", address1);
-
-        String address2 = manager.getAbsoluteAddress("/mycontext", 
"/myservice");
-        assertEquals("http://"; + localIp + ":8181/mycontext/myservice", 
address2);
-
-        c.verify();
-    }
-
-    public void testRegisterAndUnregisterServlet() throws Exception {
-        IMocksControl c = EasyMock.createControl();
-        BundleContext dswContext = c.createMock(BundleContext.class);
-        Filter filter = c.createMock(Filter.class);
-        
expect(dswContext.createFilter(EasyMock.eq("(service.id=12345)"))).andReturn(filter).once();
-        Capture<ServiceListener> captured = EasyMock.newCapture();
-        dswContext.addServiceListener(EasyMock.capture(captured), 
EasyMock.<String>anyObject());
-        expectLastCall().atLeastOnce();
-        
expect(dswContext.getProperty("org.apache.cxf.httpservice.requirefilter")).andReturn(null).atLeastOnce();
-        ServletConfig config = c.createMock(ServletConfig.class);
-        
expect(config.getInitParameter(EasyMock.<String>anyObject())).andReturn(null).atLeastOnce();
-        ServletContext servletContext = c.createMock(ServletContext.class);
-        expect(config.getServletContext()).andReturn(servletContext);
-        final HttpService httpService = new DummyHttpService(config);
-        ServiceReference<?> sr = c.createMock(ServiceReference.class);
-        
expect(sr.getProperty(EasyMock.eq("service.id"))).andReturn(12345L).atLeastOnce();
-        
expect(servletContext.getResourceAsStream((String)EasyMock.anyObject())).andReturn(null).anyTimes();
-        c.replay();
-
-        HttpServiceManager h = new HttpServiceManager(dswContext, null, null, 
null) {
-            @Override
-            protected HttpService getHttpService() {
-                return httpService;
-            }
-        };
-        Bus bus = BusFactory.newInstance().createBus();
-        h.registerServlet(bus, "/myService", dswContext, 12345L);
-
-        ServiceEvent event = new ServiceEvent(ServiceEvent.UNREGISTERING, sr);
-        captured.getValue().serviceChanged(event);
-        c.verify();
-    }
-
-    static class DummyHttpService implements HttpService {
-
-        private ServletConfig config;
-
-        DummyHttpService(ServletConfig config) {
-            this.config = config;
-        }
-
-        @SuppressWarnings("rawtypes")
-        public void registerServlet(String alias, Servlet servlet, Dictionary 
initparams, HttpContext context)
-            throws ServletException, NamespaceException {
-            Assert.assertEquals("/myService", alias);
-            servlet.init(config);
-        }
-
-        public void registerResources(String alias, String name, HttpContext 
context) throws NamespaceException {
-            throw new RuntimeException("This method should not be called");
-        }
-
-        public void unregister(String alias) {
-        }
-
-        public HttpContext createDefaultHttpContext() {
-            return EasyMock.createNiceMock(HttpContext.class);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1425743f/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
----------------------------------------------------------------------
diff --git 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
 
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
deleted file mode 100644
index 6c8e35a..0000000
--- 
a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/**
- * 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.cxf.dosgi.dsw.handlers;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.apache.cxf.dosgi.dsw.Constants;
-import org.apache.cxf.jaxrs.provider.JAXBElementProvider;
-import org.apache.cxf.jaxrs.provider.aegis.AegisElementProvider;
-import org.easymock.EasyMock;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.remoteserviceadmin.RemoteConstants;
-
-public class JaxRSUtilsTest extends TestCase {
-
-    private void addRequiredProps(Map<String, Object> props) {
-        props.put(RemoteConstants.ENDPOINT_ID, "http://google.de";);
-        props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, 
"myGreatConfiguration");
-        props.put(org.osgi.framework.Constants.OBJECTCLASS, new String[] 
{"my.class"});
-    }
-
-    public void testNoGlobalProviders() {
-        Map<String, Object> props = new HashMap<String, Object>();
-        addRequiredProps(props);
-        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
-
-        assertEquals(0, JaxRSUtils.getProviders(null, props).size());
-    }
-
-    public void testAegisProvider() {
-        Map<String, Object> props = new HashMap<String, Object>();
-        props.put(Constants.RS_DATABINDING_PROP_KEY, "aegis");
-        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
-
-        addRequiredProps(props);
-
-        List<Object> providers = JaxRSUtils.getProviders(null, props);
-        assertEquals(1, providers.size());
-        assertEquals(AegisElementProvider.class.getName(), 
providers.get(0).getClass().getName());
-    }
-
-    @SuppressWarnings("rawtypes")
-    public void testServiceProviders() {
-        Map<String, Object> props = new HashMap<String, Object>();
-        props.put(Constants.RS_PROVIDER_PROP_KEY, new Object[] {
-            new AegisElementProvider()
-        });
-        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
-        addRequiredProps(props);
-
-        List<Object> providers = JaxRSUtils.getProviders(null, props);
-        assertEquals(1, providers.size());
-        assertEquals(AegisElementProvider.class.getName(), 
providers.get(0).getClass().getName());
-    }
-
-    public void testServiceProviderProperty() throws Exception {
-        BundleContext bc = EasyMock.createMock(BundleContext.class);
-        Bundle bundle = EasyMock.createMock(Bundle.class);
-        bc.getBundle();
-        EasyMock.expectLastCall().andReturn(bundle).times(2);
-        bundle.loadClass(AegisElementProvider.class.getName());
-        EasyMock.expectLastCall().andReturn(AegisElementProvider.class);
-        bundle.loadClass(JAXBElementProvider.class.getName());
-        EasyMock.expectLastCall().andReturn(JAXBElementProvider.class);
-        EasyMock.replay(bc, bundle);
-
-        Map<String, Object> props = new HashMap<String, Object>();
-        props.put(Constants.RS_PROVIDER_PROP_KEY,
-                "\r\n " + AegisElementProvider.class.getName() + " , \r\n"
-                        + JAXBElementProvider.class.getName() + "\r\n");
-
-        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
-        addRequiredProps(props);
-
-        List<Object> providers = JaxRSUtils.getProviders(bc, props);
-        assertEquals(2, providers.size());
-        assertEquals(AegisElementProvider.class.getName(), 
providers.get(0).getClass().getName());
-        assertEquals(JAXBElementProvider.class.getName(), 
providers.get(1).getClass().getName());
-    }
-
-    public void testServiceProviderStrings() throws Exception {
-        BundleContext bc = EasyMock.createMock(BundleContext.class);
-        Bundle bundle = EasyMock.createMock(Bundle.class);
-        bc.getBundle();
-        EasyMock.expectLastCall().andReturn(bundle).times(2);
-        bundle.loadClass(AegisElementProvider.class.getName());
-        EasyMock.expectLastCall().andReturn(AegisElementProvider.class);
-        bundle.loadClass(JAXBElementProvider.class.getName());
-        EasyMock.expectLastCall().andReturn(JAXBElementProvider.class);
-        EasyMock.replay(bc, bundle);
-
-        Map<String, Object> props = new HashMap<String, Object>();
-        props.put(Constants.RS_PROVIDER_PROP_KEY, new String[] {
-            "\r\n " + AegisElementProvider.class.getName(),
-            JAXBElementProvider.class.getName() + "\r\n"
-        });
-
-        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
-        addRequiredProps(props);
-
-        List<Object> providers = JaxRSUtils.getProviders(bc, props);
-        assertEquals(2, providers.size());
-        assertEquals(AegisElementProvider.class.getName(), 
providers.get(0).getClass().getName());
-        assertEquals(JAXBElementProvider.class.getName(), 
providers.get(1).getClass().getName());
-    }
-
-    @SuppressWarnings({
-     "rawtypes", "unchecked"
-    })
-    public void testCustomGlobalProvider() throws Exception {
-        ServiceReference sref = 
EasyMock.createNiceMock(ServiceReference.class);
-        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
-        bc.getServiceReferences((String)null, JaxRSUtils.PROVIDERS_FILTER);
-        EasyMock.expectLastCall().andReturn(new ServiceReference[] {sref});
-        sref.getProperty(Constants.RS_PROVIDER_EXPECTED_PROP_KEY);
-        EasyMock.expectLastCall().andReturn(false);
-        bc.getService(sref);
-        AegisElementProvider<?> p = new AegisElementProvider();
-        EasyMock.expectLastCall().andReturn(p);
-        EasyMock.replay(bc, sref);
-        Map<String, Object> props = new HashMap<String, Object>();
-        addRequiredProps(props);
-
-        List<Object> providers = JaxRSUtils.getProviders(bc, props);
-        assertEquals(1, providers.size());
-        assertSame(p, providers.get(0));
-    }
-
-    @SuppressWarnings({
-     "rawtypes", "unchecked"
-    })
-    public void testNoCustomGlobalProvider() throws Exception {
-        ServiceReference sref = 
EasyMock.createNiceMock(ServiceReference.class);
-        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
-        bc.getServiceReferences((String)null, JaxRSUtils.PROVIDERS_FILTER);
-        EasyMock.expectLastCall().andReturn(new ServiceReference[] {sref});
-        sref.getProperty(Constants.RS_PROVIDER_PROP_KEY);
-        EasyMock.expectLastCall().andReturn(false);
-        bc.getService(sref);
-        AegisElementProvider<?> p = new AegisElementProvider();
-        EasyMock.expectLastCall().andReturn(p);
-        EasyMock.replay(bc);
-        Map<String, Object> props = new HashMap<String, Object>();
-        props.put(Constants.RS_PROVIDER_EXPECTED_PROP_KEY, "true");
-        addRequiredProps(props);
-
-        List<Object> providers = JaxRSUtils.getProviders(bc, props);
-        assertEquals(0, providers.size());
-    }
-
-    @SuppressWarnings({
-     "rawtypes", "unchecked"
-    })
-    public void testCustomGlobalProviderExpected() throws Exception {
-        ServiceReference sref = 
EasyMock.createNiceMock(ServiceReference.class);
-        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
-        bc.getServiceReferences((String)null, JaxRSUtils.PROVIDERS_FILTER);
-        EasyMock.expectLastCall().andReturn(new ServiceReference[] {sref});
-        sref.getProperty(Constants.RS_PROVIDER_PROP_KEY);
-        EasyMock.expectLastCall().andReturn(true);
-        bc.getService(sref);
-        AegisElementProvider<?> p = new AegisElementProvider();
-        EasyMock.expectLastCall().andReturn(p);
-        EasyMock.replay(bc, sref);
-        Map<String, Object> props = new HashMap<String, Object>();
-        props.put(Constants.RS_PROVIDER_EXPECTED_PROP_KEY, "true");
-        addRequiredProps(props);
-
-        List<Object> providers = JaxRSUtils.getProviders(bc, props);
-        assertEquals(1, providers.size());
-        assertSame(p, providers.get(0));
-    }
-}

Reply via email to