Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA21B10D50 for ; Thu, 15 Aug 2013 20:43:26 +0000 (UTC) Received: (qmail 73255 invoked by uid 500); 15 Aug 2013 20:41:58 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 72997 invoked by uid 500); 15 Aug 2013 20:41:24 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 72960 invoked by uid 99); 15 Aug 2013 20:41:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Aug 2013 20:41:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Aug 2013 20:40:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 085BD23889BF; Thu, 15 Aug 2013 20:40:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1514476 [2/2] - in /cxf/dosgi/trunk: discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/publish/ discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/subscribe/ ... Date: Thu, 15 Aug 2013 20:40:30 -0000 To: commits@cxf.apache.org From: cschneider@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130815204032.085BD23889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: cxf/dosgi/trunk/discovery/local/src/test/resources/ed2-generated.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/local/src/test/resources/ed2-generated.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/discovery/local/src/test/resources/ed2-generated.xml (original) +++ cxf/dosgi/trunk/discovery/local/src/test/resources/ed2-generated.xml Thu Aug 15 20:40:29 2013 @@ -1,53 +1,54 @@ - - - - - - com.acme.HelloService - some.other.Service - - - - - - - - - - - - - - - - - - - - - - - true - false - - - - - - - - Hello there - How are you? - - - - - 1 - 2 - - - - + + + + + + com.acme.HelloService + some.other.Service + + + + + + + + + + + + + + + + + + + + + true + false + + + + + + + + Hello there + How are you? + + + + + 1 + 2 + + + + Modified: cxf/dosgi/trunk/distribution/features/src/main/resources/features.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/features/src/main/resources/features.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/distribution/features/src/main/resources/features.xml (original) +++ cxf/dosgi/trunk/distribution/features/src/main/resources/features.xml Thu Aug 15 20:40:29 2013 @@ -25,7 +25,6 @@ cxf-databinding-aegis cxf-http-jetty mvn:org.osgi/org.osgi.enterprise/${osgi.enterprise.version} - mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jdom/${jdom.version} mvn:${project.groupId}/cxf-dosgi-ri-topology-manager/${project.version} mvn:${project.groupId}/cxf-dosgi-ri-dsw-cxf/${project.version} Modified: cxf/dosgi/trunk/distribution/multi-bundle/pom.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/multi-bundle/pom.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/distribution/multi-bundle/pom.xml (original) +++ cxf/dosgi/trunk/distribution/multi-bundle/pom.xml Thu Aug 15 20:40:29 2013 @@ -80,11 +80,6 @@ 2.6 - org.apache.servicemix.bundles - org.apache.servicemix.bundles.jdom - ${jdom.version} - - org.springframework spring-core ${spring.version} Modified: cxf/dosgi/trunk/distribution/multi-bundle/src/main/appended-resources/META-INF/NOTICE URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/multi-bundle/src/main/appended-resources/META-INF/NOTICE?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/distribution/multi-bundle/src/main/appended-resources/META-INF/NOTICE (original) +++ cxf/dosgi/trunk/distribution/multi-bundle/src/main/appended-resources/META-INF/NOTICE Thu Aug 15 20:40:29 2013 @@ -16,12 +16,6 @@ This product also includes WS-* schemas (http://www.w3.org/2005/08/addressing/ws-addr.xsd) -This product contains includes JDOM: - Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. - All rights reserved. - See the NOTICE.jdom file for additional information - - The product contains code (StaxBuilder.java) that is Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. All rights reserved. @@ -32,10 +26,8 @@ Java classes (source and binary) under o are generated from schema available here: (http://java.sun.com/xml/ns/javaee/javaee_5.xsd) - Portions of the included XmlSchema library are Copyright 2006 International Business Machines Corp. - Portions of the included xml-apis library were originally based on the following: - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. - software copyright (c) 1999, Sun Microsystems., http://www.sun.com. @@ -45,5 +37,3 @@ Portions of the included xml-apis librar Portions of the included xmlbeans library were originally based on the following: - software copyright (c) 2000-2003, BEA Systems, . - - Modified: cxf/dosgi/trunk/distribution/multi-bundle/src/main/assembly/assembly.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/multi-bundle/src/main/assembly/assembly.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/distribution/multi-bundle/src/main/assembly/assembly.xml (original) +++ cxf/dosgi/trunk/distribution/multi-bundle/src/main/assembly/assembly.xml Thu Aug 15 20:40:29 2013 @@ -43,13 +43,6 @@ apache-cxf-dosgi-ri-${dosgi.version} - src/main/resources/META-INF - - NOTICE.jdom - - apache-cxf-dosgi-ri-${dosgi.version} - - src/main/release README Modified: cxf/dosgi/trunk/distribution/multi-bundle/src/main/resources/distro_bundles.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/multi-bundle/src/main/resources/distro_bundles.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/distribution/multi-bundle/src/main/resources/distro_bundles.xml (original) +++ cxf/dosgi/trunk/distribution/multi-bundle/src/main/resources/distro_bundles.xml Thu Aug 15 20:40:29 2013 @@ -7,7 +7,6 @@ cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/geronimo-javamail_1.4_spec-1.7.1.jar cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/geronimo-servlet_3.0_spec-1.0.jar cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/geronimo-ws-metadata_2.0_spec-1.1.3.jar - cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.servicemix.bundles.jdom-${jdom.version}.jar cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/commons-lang-2.6.jar cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/spring-core-${spring.version}.jar cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/spring-beans-${spring.version}.jar Modified: cxf/dosgi/trunk/distribution/multi-bundle2/src/main/assembly/assembly.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/multi-bundle2/src/main/assembly/assembly.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/distribution/multi-bundle2/src/main/assembly/assembly.xml (original) +++ cxf/dosgi/trunk/distribution/multi-bundle2/src/main/assembly/assembly.xml Thu Aug 15 20:40:29 2013 @@ -43,13 +43,6 @@ apache-cxf-dosgi-ri-${dosgi.version} - src/main/resources/META-INF - - NOTICE.jdom - - apache-cxf-dosgi-ri-${dosgi.version} - - src/main/release README Modified: cxf/dosgi/trunk/dsw/cxf-dsw/pom.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/pom.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/dsw/cxf-dsw/pom.xml (original) +++ cxf/dosgi/trunk/dsw/cxf-dsw/pom.xml Thu Aug 15 20:40:29 2013 @@ -82,11 +82,6 @@ - org.apache.servicemix.bundles - org.apache.servicemix.bundles.jdom - ${jdom.version} - - junit junit test @@ -101,6 +96,17 @@ + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + + generate + + + + + org.apache.felix maven-bundle-plugin true Added: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParser.java URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParser.java?rev=1514476&view=auto ============================================================================== --- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParser.java (added) +++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParser.java Thu Aug 15 20:40:29 2013 @@ -0,0 +1,79 @@ +/** + * 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.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.XMLConstants; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.xml.sax.SAXException; +import org.apache.cxf.xmlns.service_decoration._1_0.ServiceDecorationType; +import org.apache.cxf.xmlns.service_decoration._1_0.ServiceDecorationsType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class DecorationParser { + private static final Logger LOG = LoggerFactory.getLogger(ServiceDecoratorImpl.class); + private JAXBContext jaxbContext; + private Schema schema; + + DecorationParser() { + try { + jaxbContext = JAXBContext.newInstance(ServiceDecorationsType.class.getPackage().getName(), + this.getClass().getClassLoader()); + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + URL resource = getClass().getResource("/service-decoration.xsd"); + schema = schemaFactory.newSchema(resource); + } catch (JAXBException e) { + throw new RuntimeException(e.getMessage(), e); + } catch (SAXException e) { + throw new RuntimeException("Error loading decorations schema", e); + } + + } + + List getDecorations(URL resourceURL) { + if (resourceURL == null) { + return new ArrayList(); + } + try { + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + unmarshaller.setSchema(schema); + InputStream is = resourceURL.openStream(); + Source source = new StreamSource(is); + JAXBElement jaxb = unmarshaller.unmarshal(source, ServiceDecorationsType.class); + ServiceDecorationsType decorations = jaxb.getValue(); + return decorations.getServiceDecoration(); + } catch (Exception ex) { + LOG.warn("Problem parsing: " + resourceURL, ex); + return new ArrayList(); + } + } +} Propchange: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParser.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRule.java URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRule.java?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRule.java (original) +++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRule.java Thu Aug 15 20:40:29 2013 @@ -51,7 +51,7 @@ public class InterfaceRule implements Ru public synchronized void addProperty(String name, String value, String type) { Object obj = value; - if (!String.class.getName().equals(type)) { + if (type != null && !String.class.getName().equals(type)) { try { Class cls = getClass().getClassLoader().loadClass(type); Constructor ctor = cls.getConstructor(new Class[] {String.class}); Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java (original) +++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java Thu Aug 15 20:40:29 2013 @@ -26,72 +26,56 @@ import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; -import org.jdom.input.SAXBuilder; +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.osgi.framework.Bundle; import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class ServiceDecoratorImpl implements ServiceDecorator { - - private static final Logger LOG = LoggerFactory.getLogger(ServiceDecoratorImpl.class); - final List decorations = new CopyOnWriteArrayList(); + private DecorationParser parser; + + public ServiceDecoratorImpl() { + parser = new DecorationParser(); + } + public void decorate(ServiceReference sref, Map target) { for (Rule matcher : decorations) { matcher.apply(sref, target); } } - @SuppressWarnings("unchecked") void addDecorations(Bundle bundle) { - Namespace ns = Namespace.getNamespace("http://cxf.apache.org/xmlns/service-decoration/1.0.0"); - for (Element decoration : getDecorationElements(bundle)) { - for (Element match : (List) decoration.getChildren("match", ns)) { - InterfaceRule m = new InterfaceRule(bundle, match.getAttributeValue("interface")); - for (Element propMatch : (List) match.getChildren("match-property", ns)) { - m.addPropMatch(propMatch.getAttributeValue("name"), propMatch.getAttributeValue("value")); - } - for (Element addProp : (List) match.getChildren("add-property", ns)) { - m.addProperty(addProp.getAttributeValue("name"), - addProp.getAttributeValue("value"), - addProp.getAttributeValue("type", String.class.getName())); - } - decorations.add(m); + for (ServiceDecorationType decoration : getDecorationElements(bundle)) { + for (MatchType match : decoration.getMatch()) { + decorations.add(getRule(bundle, match)); } } } - @SuppressWarnings({ "rawtypes", "unchecked" }) - static List getDecorationElements(Bundle bundle) { - Enumeration entries = bundle.findEntries("OSGI-INF/remote-service", "*.xml", false); - return getDecorationElementsForEntries(entries); + private Rule getRule(Bundle bundle, MatchType match) { + InterfaceRule m = new InterfaceRule(bundle, match.getInterface()); + for (MatchPropertyType propMatch : match.getMatchProperty()) { + m.addPropMatch(propMatch.getName(), propMatch.getValue()); + } + for (AddPropertyType addProp : match.getAddProperty()) { + m.addProperty(addProp.getName(), addProp.getValue(), addProp.getType()); + } + return m; } - /** - * Only for tests - * @param entries - * @return - */ - @SuppressWarnings("unchecked") - static List getDecorationElementsForEntries(Enumeration entries) { + List getDecorationElements(Bundle bundle) { + @SuppressWarnings("rawtypes") + Enumeration entries = bundle.findEntries("OSGI-INF/remote-service", "*.xml", false); if (entries == null) { return Collections.emptyList(); } - List elements = new ArrayList(); + List elements = new ArrayList(); while (entries.hasMoreElements()) { - URL resourceURL = entries.nextElement(); - try { - Document d = new SAXBuilder().build(resourceURL.openStream()); - Namespace ns = Namespace.getNamespace("http://cxf.apache.org/xmlns/service-decoration/1.0.0"); - elements.addAll(d.getRootElement().getChildren("service-decoration", ns)); - } catch (Exception ex) { - LOG.warn("Problem parsing: " + resourceURL, ex); - } + elements.addAll(parser.getDecorations((URL)entries.nextElement())); } return elements; } Added: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/resources/service-decoration.xsd URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/resources/service-decoration.xsd?rev=1514476&view=auto ============================================================================== --- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/resources/service-decoration.xsd (added) +++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/resources/service-decoration.xsd Thu Aug 15 20:40:29 2013 @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Propchange: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/resources/service-decoration.xsd ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java?rev=1514476&view=auto ============================================================================== --- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java (added) +++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java Thu Aug 15 20:40:29 2013 @@ -0,0 +1,60 @@ +/** + * 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.List; + +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() { + URL resource = getClass().getResource("/test-resources/sd.xml"); + List 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() { + List elements = new DecorationParser().getDecorations(null); + Assert.assertEquals(0, elements.size()); + } +} Propchange: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/DecorationParserTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java (original) +++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java Thu Aug 15 20:40:29 2013 @@ -21,9 +21,7 @@ package org.apache.cxf.dosgi.dsw.decorat import java.net.URL; import java.util.Arrays; import java.util.Collections; -import java.util.Enumeration; import java.util.HashMap; -import java.util.List; import java.util.Map; import junit.framework.Assert; @@ -31,7 +29,6 @@ import junit.framework.TestCase; import org.easymock.EasyMock; import org.easymock.IAnswer; -import org.jdom.Element; import org.osgi.framework.Bundle; import org.osgi.framework.Constants; import org.osgi.framework.ServiceReference; @@ -44,20 +41,6 @@ public class ServiceDecoratorImplTest ex private static final URL RES_SD0 = getResource("/test-resources/sd0.xml"); private static final URL RES_SD_1 = getResource("/test-resources/sd-1.xml"); - public void testGetDecoratorElements() { - Enumeration urls = Collections.enumeration(Collections.singletonList(RES_SD)); - - List elements = ServiceDecoratorImpl.getDecorationElementsForEntries(urls); - assertEquals(1, elements.size()); - assertEquals("service-decoration", elements.get(0).getName()); - assertEquals("http://cxf.apache.org/xmlns/service-decoration/1.0.0", elements.get(0).getNamespaceURI()); - } - - public void testGetDecoratorElements2() { - List elements = ServiceDecoratorImpl.getDecorationElementsForEntries(null); - assertEquals(0, elements.size()); - } - public void testAddRemoveDecorations() { final Map serviceProps = new HashMap(); serviceProps.put(Constants.OBJECTCLASS, new String[] {"org.acme.foo.Bar"}); Modified: cxf/dosgi/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/parent/pom.xml?rev=1514476&r1=1514475&r2=1514476&view=diff ============================================================================== --- cxf/dosgi/trunk/parent/pom.xml (original) +++ cxf/dosgi/trunk/parent/pom.xml Thu Aug 15 20:40:29 2013 @@ -75,8 +75,6 @@ 1.6.4 2.4.0 2.6.0 - 1.1.2_1 -