cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [1/4] cxf git commit: Experimentally simply remove spring and blueprint related classes to see how much cxf is tied to it
Date Fri, 23 Sep 2016 11:29:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/poc-remove-spring-bp [created] 5e9659557


http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java b/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
deleted file mode 100644
index 60d6101..0000000
--- a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
+++ /dev/null
@@ -1,48 +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.bus.spring;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import org.springframework.beans.BeansException;
-
-public class BusApplicationContextTest extends Assert {
-       
-    @Test
-    public void testGetResources() {
-        BusApplicationContext ctx = null;
-
-        try { 
-            ctx = new BusApplicationContext("nowhere.xml", false);
-            fail("Bus creation should have thrown exception.");
-        } catch (BeansException bex) {
-            //Expected
-        }
-
-        String cfgFile = "/org/apache/cxf/bus/spring/resources/bus-overwrite.xml";
-        ctx = new BusApplicationContext(cfgFile, false);
-        assertEquals("Unexpected number of resources", 1, ctx.getConfigResources().length);
-        ctx.close();
-        ctx = new BusApplicationContext(cfgFile, true);
-        assertEquals("Unexpected number of resources", 2, ctx.getConfigResources().length);
-        ctx.close();
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
b/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
deleted file mode 100644
index 9b0b7a3..0000000
--- a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
+++ /dev/null
@@ -1,53 +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.bus.spring;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.bus.managers.CXFBusLifeCycleManager;
-import org.apache.cxf.buslifecycle.BusLifeCycleListener;
-import org.easymock.EasyMock;
-import org.junit.Assert;
-import org.junit.Test;
-import org.springframework.context.support.AbstractRefreshableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-
-
-public class BusApplicationListenerTest extends Assert {
-    
-    @Test
-    public void testParentApplicationEvent() {
-        AbstractRefreshableApplicationContext parent = new ClassPathXmlApplicationContext();
-        parent.refresh();
-        SpringBusFactory factory = new SpringBusFactory(parent);
-        Bus bus = factory.createBus();
-        CXFBusLifeCycleManager manager = bus.getExtension(CXFBusLifeCycleManager.class);
-        BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
-        manager.registerLifeCycleListener(listener);
-        EasyMock.reset(listener);
-        listener.preShutdown();
-        EasyMock.expectLastCall().times(1);
-        listener.postShutdown();
-        EasyMock.expectLastCall().times(1);
-        EasyMock.replay(listener);
-        parent.close();
-        EasyMock.verify(listener);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java b/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
deleted file mode 100644
index 2c63150..0000000
--- a/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
+++ /dev/null
@@ -1,168 +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.bus.spring;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.annotation.PostConstruct;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.buslifecycle.BusLifeCycleListener;
-import org.apache.cxf.buslifecycle.BusLifeCycleManager;
-import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.feature.Feature;
-import org.apache.cxf.interceptor.Interceptor;
-import org.apache.cxf.interceptor.LoggingInInterceptor;
-import org.apache.cxf.message.Message;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class BusDefinitionParserTest extends Assert {
-    
-    @Test
-    public void testFeatures() {
-        String cfgFile = "org/apache/cxf/bus/spring/bus.xml";
-        Bus bus = new SpringBusFactory().createBus(cfgFile, true);
-        
-        List<Interceptor<? extends Message>> in = bus.getInInterceptors();
-        boolean found = false;
-        for (Interceptor<? extends Message> i : in) {
-            if (i instanceof LoggingInInterceptor) {
-                found = true;
-            }
-        }
-        assertTrue("could not find logging interceptor.", found);
-   
-        Collection<Feature> features = bus.getFeatures();
-        TestFeature tf = null;
-        for (Feature f : features) {
-            if (f instanceof TestFeature) {
-                tf = (TestFeature)f;
-                break;
-            }
-        }
-        
-        assertNotNull(tf);
-        assertTrue("test feature  has not been initialised", tf.initialised);
-        assertNotNull("test feature has not been injected", tf.testBean);
-        assertTrue("bean injected into test feature has not been initialised", tf.testBean.initialised);
-    }
-    
-    @Test
-    public void testBusConfigure() {
-        ClassPathXmlApplicationContext context = null;
-        try {
-            context = new ClassPathXmlApplicationContext("org/apache/cxf/bus/spring/customerBus.xml");
-            Bus cxf1 = (Bus)context.getBean("cxf1");
-            
-            assertTrue(cxf1.getOutInterceptors().size() == 1);
-            assertTrue(cxf1.getInInterceptors().size() == 0);
-            
-            Bus cxf2 = (Bus)context.getBean("cxf2");
-            assertTrue(cxf2.getInInterceptors().size() == 1);
-            assertTrue(cxf2.getOutInterceptors().size() == 0);
-        } finally {
-            if (context != null) {
-                context.close();
-            }
-        }
-    }
-    @Test
-    public void testBusConfigureCreateBus() {
-        ClassPathXmlApplicationContext context = null;
-        final AtomicBoolean b = new AtomicBoolean();
-        try {
-            context = new ClassPathXmlApplicationContext("org/apache/cxf/bus/spring/customerBus2.xml");
-            Bus cxf1 = (Bus)context.getBean("cxf1");
-            
-            assertTrue(cxf1.getOutInterceptors().size() == 1);
-            assertTrue(cxf1.getInInterceptors().size() == 0);
-            
-            Bus cxf2 = (Bus)context.getBean("cxf2");
-            
-            assertTrue(cxf2.getInInterceptors().size() == 1);
-            assertTrue(cxf2.getOutInterceptors().size() == 0);
-            
-            cxf2.getExtension(BusLifeCycleManager.class)
-                .registerLifeCycleListener(new BusLifeCycleListener() {
-                    public void initComplete() {
-                    }
-
-                    public void preShutdown() {
-                    }
-
-                    public void postShutdown() {
-                        b.set(true);
-                    }
-                    
-                });
-        } finally {
-            if (context != null) {
-                context.close();
-            }
-        }
-        assertTrue("postShutdown not called", b.get());
-    }
-    @Test
-    public void testLazyInit() {
-        String cfgFile = "org/apache/cxf/bus/spring/lazyInitBus.xml";
-        Bus bus = new SpringBusFactory().createBus(cfgFile, true);
-
-        List<Interceptor<? extends Message>> in = bus.getInInterceptors();
-        boolean found = false;
-        for (Interceptor<? extends Message> i : in) {
-            if (i instanceof LoggingInInterceptor) {
-                found = true;
-            }
-        }
-        assertTrue("could not find logging interceptor.", found);
-    }
-
-    static class TestBean {
-
-        boolean initialised;
-        
-        @PostConstruct
-        public void initialise() {
-            initialised = true;
-        }
-    }
-    
-    static class TestFeature extends AbstractFeature {
-        
-        boolean initialised;
-        TestBean testBean;
-        
-        @PostConstruct
-        public void initialise() {
-            initialised = true;
-        }
-
-        public void setTestBean(TestBean tb) {
-            testBean = tb;
-        }
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java b/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
deleted file mode 100644
index bf4a96a..0000000
--- a/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
+++ /dev/null
@@ -1,279 +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.bus.spring;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.List;
-import java.util.SortedSet;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusException;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.binding.BindingFactoryManager;
-import org.apache.cxf.bus.managers.PhaseManagerImpl;
-import org.apache.cxf.buslifecycle.BusLifeCycleListener;
-import org.apache.cxf.buslifecycle.BusLifeCycleManager;
-import org.apache.cxf.configuration.Configurer;
-import org.apache.cxf.endpoint.ServerRegistry;
-import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.feature.Feature;
-import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.interceptor.Interceptor;
-import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.Phase;
-import org.apache.cxf.phase.PhaseManager;
-import org.apache.cxf.resource.ResourceManager;
-import org.apache.cxf.transport.ConduitInitiatorManager;
-import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.workqueue.WorkQueueManager;
-import org.easymock.EasyMock;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class SpringBusFactoryTest extends Assert {
-
-    @After
-    public void tearDown() {
-        BusFactory.setDefaultBus(null);
-    }
-    
-    @Test
-    public void testDefault() {
-        Bus bus = new SpringBusFactory().createBus();
-        assertNotNull(bus);
-        BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);  
-        assertNotNull("No binding factory manager", bfm);
-        assertNotNull("No configurer", bus.getExtension(Configurer.class));
-        assertNotNull("No resource manager", bus.getExtension(ResourceManager.class));
-        assertNotNull("No destination factory manager", bus.getExtension(DestinationFactoryManager.class));
-        assertNotNull("No conduit initiator manager", bus.getExtension(ConduitInitiatorManager.class));
-        assertNotNull("No phase manager", bus.getExtension(PhaseManager.class));
-        assertNotNull("No workqueue manager", bus.getExtension(WorkQueueManager.class));
-        assertNotNull("No lifecycle manager", bus.getExtension(BusLifeCycleManager.class));
-        assertNotNull("No service registry", bus.getExtension(ServerRegistry.class));
-        
-        try {
-            bfm.getBindingFactory("http://cxf.apache.org/unknown");
-        } catch (BusException ex) {
-            // expected
-        }
-        
-        assertEquals("Unexpected interceptors", 0, bus.getInInterceptors().size());
-        assertEquals("Unexpected interceptors", 0, bus.getInFaultInterceptors().size());
-        assertEquals("Unexpected interceptors", 0, bus.getOutInterceptors().size());
-        assertEquals("Unexpected interceptors", 0, bus.getOutFaultInterceptors().size());
-
-    }
-    
-    @Test
-    public void testCustomFileName() {
-        String cfgFile = "org/apache/cxf/bus/spring/resources/bus-overwrite.xml";
-        Bus bus = new SpringBusFactory().createBus(cfgFile, true);
-        checkCustomerConfiguration(bus);
-    }
-    
-    @Test
-    public void testCustomerBusShutdown() {
-        String cfgFile = "org/apache/cxf/bus/spring/customerBus.xml";
-        Bus bus = new SpringBusFactory().createBus(cfgFile, true);
-        // We have three bus here, which should be closed rightly
-        bus.shutdown(true);
-    }
-    
-    @Test
-    public void testCustomFileURLFromSystemProperty() {
-        URL cfgFileURL = this.getClass().getResource("resources/bus-overwrite.xml");    
   
-        System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_URL, cfgFileURL.toString());
-        Bus bus = new SpringBusFactory().createBus((String)null, true);
-        checkCustomerConfiguration(bus);
-        System.clearProperty(Configurer.USER_CFG_FILE_PROPERTY_URL);
-    }
-    
-    @Test
-    public void testCustomFileURL() {
-        URL cfgFileURL = this.getClass().getResource("resources/bus-overwrite.xml");
-        Bus bus = new SpringBusFactory().createBus(cfgFileURL, true);
-        checkCustomerConfiguration(bus);
-    }
-    
-    private void checkCustomerConfiguration(Bus bus) {
-        assertNotNull(bus);
-        List<Interceptor<? extends Message>> interceptors = bus.getInInterceptors();
-        assertEquals("Unexpected number of interceptors", 2, interceptors.size());
-        assertEquals("Unexpected interceptor", "in-a", interceptors.get(0).toString());
-        assertEquals("Unexpected interceptor", "in-b", interceptors.get(1).toString());
-        interceptors = bus.getInFaultInterceptors();
-        assertEquals("Unexpected number of interceptors", 1, interceptors.size());
-        assertEquals("Unexpected interceptor", "in-fault", interceptors.get(0).toString());
-        interceptors = bus.getOutFaultInterceptors();
-        assertEquals("Unexpected number of interceptors", 1, interceptors.size());
-        assertEquals("Unexpected interceptor", "out-fault", interceptors.get(0).toString());
-        interceptors = bus.getOutInterceptors();
-        assertEquals("Unexpected number of interceptors", 1, interceptors.size());
-        assertEquals("Unexpected interceptor", "out", interceptors.get(0).toString());
-    }
-    
-    @Test
-    public void testForLifeCycle() {
-        BusLifeCycleListener bl = EasyMock.createMock(BusLifeCycleListener.class);
-        Bus bus = new SpringBusFactory().createBus();
-        BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
-        lifeCycleManager.registerLifeCycleListener(bl);
-        EasyMock.reset(bl);
-        bl.preShutdown();
-        EasyMock.expectLastCall();
-        bl.postShutdown();
-        EasyMock.expectLastCall();
-        EasyMock.replay(bl);
-        bus.shutdown(true);
-        EasyMock.verify(bl);
-        
-    }
-
-    @Test
-    public void testPhases() {
-        Bus bus = new SpringBusFactory().createBus();
-        PhaseManager cxfPM = bus.getExtension(PhaseManager.class);
-        PhaseManager defaultPM = new PhaseManagerImpl();
-        SortedSet<Phase> cxfPhases = cxfPM.getInPhases();
-        SortedSet<Phase> defaultPhases = defaultPM.getInPhases();
-        assertEquals(defaultPhases.size(), cxfPhases.size());
-        assertTrue(cxfPhases.equals(defaultPhases));
-        cxfPhases = cxfPM.getOutPhases();
-        defaultPhases = defaultPM.getOutPhases();
-        assertEquals(defaultPhases.size(), cxfPhases.size());
-        assertTrue(cxfPhases.equals(defaultPhases));
-    }
-
-    @Test
-    public void testJsr250() {
-        Bus bus = new SpringBusFactory().createBus("org/apache/cxf/bus/spring/testjsr250.xml");
-        TestExtension te = bus.getExtension(TestExtension.class);
-        assertTrue("@PostConstruct annotated method has not been called.", te.postConstructMethodCalled);
-        assertTrue("@PreDestroy annoated method has been called already.", !te.preDestroyMethodCalled);
-        bus.shutdown(true);
-        assertTrue("@PreDestroy annotated method has not been called.", te.preDestroyMethodCalled);
-        
-    }
-
-    @Test
-    public void testInitialisation() {
-        Bus bus = new SpringBusFactory().createBus("org/apache/cxf/bus/spring/init.xml");
-        assertNotNull(bus.getExtension(TestListener.class));           
-        assertSame(bus, bus.getExtension(BusApplicationContext.class).getBean("cxf"));
-    }
-
-    
-    static class TestInterceptor implements Interceptor<Message> {
-
-        private String name;
-        
-        TestInterceptor() {            
-        }
-        
-        public void setName(String n) {
-            name = n;
-        }
-               
-        @Override
-        public String toString() {
-            return name;
-        }
-        
-        public void handleFault(Message message) {  
-        }
-
-        public void handleMessage(Message message) throws Fault {   
-        }
-        
-        public void postHandleMessage(Message message) throws Fault {            
-        }
-        
-    }
-
-    static class TestExtension {
-
-        boolean postConstructMethodCalled;
-        boolean preDestroyMethodCalled;
-
-        TestExtension(Bus bus) {
-            bus.setExtension(this, TestExtension.class);
-        }
- 
-        @PostConstruct
-        void postConstructMethod() {
-            postConstructMethodCalled = true;
-        }
-
-        @PreDestroy
-        void preDestroyMethod() {
-            preDestroyMethodCalled = true;
-        }
-    }
-     
-    static class TestFeature extends AbstractFeature {
-        boolean initialised;
-        TestFeature() {
-            //nothing
-        }
-
-        @Override
-        public void initialize(Bus bus) {
-            initialised = true;
-        }   
-    }
-    
-    static class TestListener implements BusLifeCycleListener {
-
-        Bus bus;
- 
-        @Resource
-        public void setBus(Bus b) {        
-            bus = b;        
-        }
-        
-        @PostConstruct
-        public void register() {
-            bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this);
           
-        }
-        
-        public void initComplete() {
-            assertNull(bus.getExtension(TestFeature.class));
-            Collection<Feature> features = bus.getFeatures();
-            assertEquals(1, features.size());
-            TestFeature tf = (TestFeature)features.iterator().next();
-            assertTrue(tf.initialised);
-            bus.setExtension(this, TestListener.class);          
-        }
-
-        public void postShutdown() {
-        }
-
-        public void preShutdown() {
-        }
-        
-    }    
-}

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
b/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
deleted file mode 100644
index 6abcbf4..0000000
--- a/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
+++ /dev/null
@@ -1,412 +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.configuration.spring;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Set;
-
-import javax.xml.bind.DatatypeConverter;
-import javax.xml.bind.DatatypeConverterInterface;
-import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.cxf.bus.spring.BusApplicationContext;
-import org.apache.cxf.configuration.Configurable;
-import org.junit.Assert;
-import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-
-
-
-
-public class ConfigurerImplTest extends Assert {
-    
-    static {
-        Class<?> cls;
-        try {
-            try {
-                cls = Class.forName("com.sun.xml.bind.DatatypeConverterImpl");
-            } catch (ClassNotFoundException e) {
-                cls = Class.forName("com.sun.xml.internal.bind.DatatypeConverterImpl");
-            }
-            DatatypeConverterInterface convert = (DatatypeConverterInterface)cls.getField("theInstance")
-                                                                                .get(null);
-            DatatypeConverter.setDatatypeConverter(convert);
-        } catch (Exception ex) {
-            //ignore;
-        }
-    }
-    
-    @Test
-    public void testConfigureSimpleNoMatchingBean() {
-        SimpleBean sb = new SimpleBean("unknown");
-        
-        BusApplicationContext ac = 
-            new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
-                                      false);
-
-        ConfigurerImpl configurer = new ConfigurerImpl(ac);
-        configurer.configureBean(sb);
-        assertEquals("Unexpected value for attribute stringAttr", 
-                     "hello", sb.getStringAttr());
-        assertTrue("Unexpected value for attribute booleanAttr", 
-                   sb.getBooleanAttr());
-        assertEquals("Unexpected value for attribute integerAttr", 
-                     BigInteger.ONE, sb.getIntegerAttr());
-        assertEquals("Unexpected value for attribute intAttr", 
-                     Integer.valueOf(2), sb.getIntAttr());
-        assertEquals("Unexpected value for attribute longAttr", 
-                     Long.valueOf(3L), sb.getLongAttr());
-        assertEquals("Unexpected value for attribute shortAttr", 
-                     Short.valueOf((short)4), sb.getShortAttr());
-        assertEquals("Unexpected value for attribute decimalAttr", 
-                     new BigDecimal("5"), sb.getDecimalAttr());
-        assertEquals("Unexpected value for attribute floatAttr", 
-                     new Float(6F), sb.getFloatAttr());
-        assertEquals("Unexpected value for attribute doubleAttr", 
-                     Double.valueOf(7.0D), sb.getDoubleAttr());
-        assertEquals("Unexpected value for attribute byteAttr", 
-                     Byte.valueOf((byte)8), sb.getByteAttr());
-        
-        QName qn = sb.getQnameAttr();
-        assertEquals("Unexpected value for attribute qnameAttrNoDefault", 
-                     "schema", qn.getLocalPart());
-        assertEquals("Unexpected value for attribute qnameAttrNoDefault",
-                     "http://www.w3.org/2001/XMLSchema", qn.getNamespaceURI());
-        byte[] expected = DatatypeConverter.parseBase64Binary("abcd");
-        byte[] val = sb.getBase64BinaryAttr();
-        assertEquals("Unexpected value for attribute base64BinaryAttrNoDefault", expected.length,
val.length);
-        for (int i = 0; i < expected.length; i++) {
-            assertEquals("Unexpected value for attribute base64BinaryAttrNoDefault", expected[i],
val[i]);
-        }
-        expected = new HexBinaryAdapter().unmarshal("aaaa");
-        val = sb.getHexBinaryAttr();
-        assertEquals("Unexpected value for attribute hexBinaryAttrNoDefault", expected.length,
val.length);
-        for (int i = 0; i < expected.length; i++) {
-            assertEquals("Unexpected value for attribute hexBinaryAttrNoDefault", expected[i],
val[i]);
-        }
-        
-        assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault", 
-                     Long.valueOf(9L), sb.getUnsignedIntAttr());
-        assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault", 
-                     Integer.valueOf(10), sb.getUnsignedShortAttr());
-        assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault", 
-                     Short.valueOf((short)11), sb.getUnsignedByteAttr());
-    }
-    
-    @Test
-    public void testConfigureSimple() {
-        // Try to configure the bean with id 
-        verifyConfigureSimple("simple");
-        // Try to configure the bean with an alias name
-        verifyConfigureSimple("simpleValueBean");
-    }
-    
-    
-    public void verifyConfigureSimple(String beanName) {
-        
-        SimpleBean sb = new SimpleBean(beanName);
-        BusApplicationContext ac = 
-            new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
-                                      false);
-
-        ConfigurerImpl configurer = new ConfigurerImpl();
-        configurer.setApplicationContext(ac);
-        
-        configurer.configureBean(sb);
-        assertEquals("Unexpected value for attribute stringAttr", 
-                     "hallo", sb.getStringAttr());
-        assertTrue("Unexpected value for attribute booleanAttr", 
-                   !sb.getBooleanAttr());
-        assertEquals("Unexpected value for attribute integerAttr", 
-                     BigInteger.TEN, sb.getIntegerAttr());
-        assertEquals("Unexpected value for attribute intAttr", 
-                     Integer.valueOf(12), sb.getIntAttr());
-        assertEquals("Unexpected value for attribute longAttr", 
-                     Long.valueOf(13L), sb.getLongAttr());
-        assertEquals("Unexpected value for attribute shortAttr", 
-                     Short.valueOf((short)14), sb.getShortAttr());
-        assertEquals("Unexpected value for attribute decimalAttr", 
-                     new BigDecimal("15"), sb.getDecimalAttr());
-        assertEquals("Unexpected value for attribute floatAttr", 
-                     new Float(16F), sb.getFloatAttr());
-        assertEquals("Unexpected value for attribute doubleAttr", 
-                     Double.valueOf(17D), sb.getDoubleAttr());
-        assertEquals("Unexpected value for attribute byteAttr", 
-                     Byte.valueOf((byte)18), sb.getByteAttr());
-        
-        assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault", 
-                     Long.valueOf(19L), sb.getUnsignedIntAttr());
-        assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault", 
-                     Integer.valueOf(20), sb.getUnsignedShortAttr());
-        assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault", 
-                     Short.valueOf((short)21), sb.getUnsignedByteAttr());
-    }
-    
-    @Test
-    public void testConfigureSimpleMatchingStarBeanId() {
-        SimpleBean sb = new SimpleBean("simple2");
-        BusApplicationContext ac = 
-            new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
-                                      false);
-
-        ConfigurerImpl configurer = new ConfigurerImpl();
-        configurer.setApplicationContext(ac);
-        configurer.configureBean(sb);
-        assertTrue("Unexpected value for attribute booleanAttr", 
-                   !sb.getBooleanAttr());
-        assertEquals("Unexpected value for attribute integerAttr", 
-                     BigInteger.TEN, sb.getIntegerAttr());
-        assertEquals("Unexpected value for attribute stringAttr", 
-                     "StarHallo", sb.getStringAttr());
-    }
-    
-    @Test
-    public void testConfigureSimpleMatchingStarBeanIdWithChildInstance() {
-        SimpleBean sb = new ChildBean("simple2");
-        BusApplicationContext ac = 
-            new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
-                                      false);
-
-        ConfigurerImpl configurer = new ConfigurerImpl();
-        configurer.setApplicationContext(ac);
-        configurer.configureBean(sb);
-        assertTrue("Unexpected value for attribute booleanAttr", 
-                   !sb.getBooleanAttr());
-        assertEquals("Unexpected value for attribute integerAttr", 
-                     BigInteger.TEN, sb.getIntegerAttr());
-        assertEquals("Unexpected value for attribute stringAttr", 
-                     "StarHallo", sb.getStringAttr());
-    }
-    
-    @Test
-    public void testGetBeanName() {
-        ConfigurerImpl configurer = new ConfigurerImpl();
-        Object beanInstance = new Configurable() {
-
-            public String getBeanName() {
-                return "a";
-            }
-        };
-        assertEquals("a", configurer.getBeanName(beanInstance));
-        final class NamedBean {
-            @SuppressWarnings("unused")
-            public String getBeanName() {
-                return "b";
-            }
-        }
-        beanInstance = new NamedBean(); 
-        assertEquals("b", configurer.getBeanName(beanInstance));
-        beanInstance = this;
-        assertNull(configurer.getBeanName(beanInstance));
-    }
-    
-    @Test
-    public void testAddApplicationContext() {
-        ConfigurableApplicationContext context1 =
-            new ClassPathXmlApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml");
-        ConfigurerImpl configurer = new ConfigurerImpl();
-        configurer.setApplicationContext(context1);
-        // Just to simulate the OSGi's uninstall command
-        context1.close();
-        
-        ConfigurableApplicationContext context2 =
-            new ClassPathXmlApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml");
-        configurer.addApplicationContext(context2);
-        Set<ApplicationContext> contexts = configurer.getAppContexts();
-        assertEquals("The Context's size is wrong", 1, contexts.size());
-        assertTrue("The conetxts' contains a wrong application context", contexts.contains(context2));
-    }
-    
-    class SimpleBean implements Configurable {
-        
-        private String beanName;
-        
-        private String stringAttr = "hello";
-        private Boolean booleanAttr = Boolean.TRUE;
-        private BigInteger integerAttr = BigInteger.ONE;
-        private Integer intAttr = Integer.valueOf(2);
-        private Long longAttr = Long.valueOf(3);
-        private Short shortAttr = Short.valueOf((short)4);
-        private BigDecimal decimalAttr = new BigDecimal("5");
-        private Float floatAttr = new Float(6F);
-        private Double doubleAttr = Double.valueOf(7D);
-        private Byte byteAttr = Byte.valueOf((byte)8);
-        private QName qnameAttr = new QName("http://www.w3.org/2001/XMLSchema", "schema",
"xs");
-        private byte[] base64BinaryAttr = DatatypeConverter.parseBase64Binary("abcd");
-        private byte[] hexBinaryAttr = new HexBinaryAdapter().unmarshal("aaaa");
-        private Long unsignedIntAttr = Long.valueOf(9);
-        private Integer unsignedShortAttr = Integer.valueOf(10);
-        private Short unsignedByteAttr = Short.valueOf((short)11);
- 
-        
-        SimpleBean(String bn) {
-            beanName = bn;
-        }
-         
-        public String getBeanName() {
-            return beanName;
-        }
-
-        public byte[] getBase64BinaryAttr() {
-            return base64BinaryAttr;
-        }
-
-        public void setBase64BinaryAttr(byte[] base64BinaryAttr) {
-            this.base64BinaryAttr = base64BinaryAttr;
-        }
-
-        public Boolean getBooleanAttr() {
-            return booleanAttr;
-        }
-
-        public void setBooleanAttr(Boolean booleanAttr) {
-            this.booleanAttr = booleanAttr;
-        }
-
-        public Byte getByteAttr() {
-            return byteAttr;
-        }
-
-        public void setByteAttr(Byte byteAttr) {
-            this.byteAttr = byteAttr;
-        }
-
-        public BigDecimal getDecimalAttr() {
-            return decimalAttr;
-        }
-
-        public void setDecimalAttr(BigDecimal decimalAttr) {
-            this.decimalAttr = decimalAttr;
-        }
-
-        public Double getDoubleAttr() {
-            return doubleAttr;
-        }
-
-        public void setDoubleAttr(Double doubleAttr) {
-            this.doubleAttr = doubleAttr;
-        }
-
-        public Float getFloatAttr() {
-            return floatAttr;
-        }
-
-        public void setFloatAttr(Float floatAttr) {
-            this.floatAttr = floatAttr;
-        }
-
-        public byte[] getHexBinaryAttr() {
-            return hexBinaryAttr;
-        }
-
-        public void setHexBinaryAttr(byte[] hexBinaryAttr) {
-            this.hexBinaryAttr = hexBinaryAttr;
-        }
-
-        public Integer getIntAttr() {
-            return intAttr;
-        }
-
-        public void setIntAttr(Integer intAttr) {
-            this.intAttr = intAttr;
-        }
-
-        public BigInteger getIntegerAttr() {
-            return integerAttr;
-        }
-
-        public void setIntegerAttr(BigInteger integerAttr) {
-            this.integerAttr = integerAttr;
-        }
-
-        public Long getLongAttr() {
-            return longAttr;
-        }
-
-        public void setLongAttr(Long longAttr) {
-            this.longAttr = longAttr;
-        }
-
-        public QName getQnameAttr() {
-            return qnameAttr;
-        }
-
-        public void setQnameAttr(QName qnameAttr) {
-            this.qnameAttr = qnameAttr;
-        }
-
-        public Short getShortAttr() {
-            return shortAttr;
-        }
-
-        public void setShortAttr(Short shortAttr) {
-            this.shortAttr = shortAttr;
-        }
-
-        public String getStringAttr() {
-            return stringAttr;
-        }
-
-        public void setStringAttr(String stringAttr) {
-            this.stringAttr = stringAttr;
-        }
-
-        public Short getUnsignedByteAttr() {
-            return unsignedByteAttr;
-        }
-
-        public void setUnsignedByteAttr(Short unsignedByteAttr) {
-            this.unsignedByteAttr = unsignedByteAttr;
-        }
-
-        public Long getUnsignedIntAttr() {
-            return unsignedIntAttr;
-        }
-
-        public void setUnsignedIntAttr(Long unsignedIntAttr) {
-            this.unsignedIntAttr = unsignedIntAttr;
-        }
-
-        public Integer getUnsignedShortAttr() {
-            return unsignedShortAttr;
-        }
-
-        public void setUnsignedShortAttr(Integer unsignedShortAttr) {
-            this.unsignedShortAttr = unsignedShortAttr;
-        }
-
-        public void setBeanName(String beanName) {
-            this.beanName = beanName;
-        }    
-    }
-    
-    class ChildBean extends SimpleBean {
-
-        ChildBean(String bn) {
-            super(bn);
-        }
-        
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/configuration/spring/bean.properties
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/spring/bean.properties b/core/src/test/java/org/apache/cxf/configuration/spring/bean.properties
deleted file mode 100644
index 9199905..0000000
--- a/core/src/test/java/org/apache/cxf/configuration/spring/bean.properties
+++ /dev/null
@@ -1,17 +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.
-simple.name=simpleValueBean

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml b/core/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml
deleted file mode 100644
index 359bb47..0000000
--- a/core/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml
+++ /dev/null
@@ -1,59 +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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-    <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
-        <property name="location" value="org/apache/cxf/configuration/spring/bean.properties"/>
-    </bean>
-    <bean name="*2" abstract="true" class="org.apache.cxf.configuration.spring.ConfigurerImplTest$SimpleBean">
-        <property name="stringAttr" value="StarHallo"/>
-    </bean>
-    <!-- additional wildcards for class SimpleBean will be ignored with a warning -->
-    <bean name="*duplicateWildcardForClassWillBeIgnored" abstract="true" class="SimpleBean">
-        <property name="stringAttr" value="duplicateWildcardForClassWillBeIgnored"/>
-    </bean>
-    <!--  wildcards bean with no class will be ignored with a warning -->
-    <bean name="*willBeIgnoredBecausOfNoClass" abstract="true">
-        <property name="stringAttr" value="willBeIgnoredBecausOfNoClass"/>
-    </bean>
-    <bean id="simple2" lazy-init="true">
-        <property name="booleanAttr" value="false"/>
-        <property name="integerAttr" value="10"/>
-    </bean>
-    <bean id="simple" name="${simple.name}" lazy-init="true">
-        <property name="stringAttr" value="hallo"/>
-        <property name="booleanAttr" value="false"/>
-        <property name="integerAttr" value="10"/>
-        <property name="intAttr" value="12"/>
-        <property name="longAttr" value="13"/>
-        <property name="shortAttr" value="14"/>
-        <property name="decimalAttr" value="15"/>
-        <property name="floatAttr" value="16"/>
-        <property name="doubleAttr" value="17"/>
-        <property name="byteAttr" value="18"/>
-        <!--
-      <property name="qnameAttr" value="xs:string"/>
-      -->
-        <property name="base64BinaryAttr" value="abcd"/>
-        <property name="hexBinaryAttr" value="bbbb"/>
-        <property name="unsignedIntAttr" value="19"/>
-        <property name="unsignedShortAttr" value="20"/>
-        <property name="unsignedByteAttr" value="21"/>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml b/core/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml
deleted file mode 100644
index 801968a..0000000
--- a/core/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml
+++ /dev/null
@@ -1,43 +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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:foo="http://cxf.apache.org/configuration/foo" xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
-    <bean id="complex" class="org.apache.cxf.configuration.spring.JaxbPropertyEditorTest$FooBean"
lazy-init="true">
-        <property name="name">
-            <value>foam</value>
-        </property>
-        <property name="position">
-            <value>
-                <foo:point>
-                    <foo:x>12</foo:x>
-                    <foo:y>33</foo:y>
-                </foo:point>
-            </value>
-        </property>
-        <property name="address">
-            <value>
-                <foo:address>
-                    <foo:city>Dublin</foo:city>
-                    <foo:zip>4</foo:zip>
-                    <foo:street>Shelbourne Rd</foo:street>
-                </foo:address>
-            </value>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/5e965955/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java b/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java
deleted file mode 100644
index f8f61f8..0000000
--- a/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java
+++ /dev/null
@@ -1,42 +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.internal;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * 
- */
-public class CXFAPINamespaceHandlerTest extends Assert {
-    @Test
-    public void testGetSchemaLocation() {
-        CXFAPINamespaceHandler handler = new CXFAPINamespaceHandler();
-        
-        assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/configuration/beans"));
-        assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/configuration/parameterized-types"));
-        assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/configuration/security"));
-        assertNotNull(handler.getSchemaLocation("http://schemas.xmlsoap.org/wsdl/"));
-        assertNotNull(handler.getSchemaLocation("http://www.w3.org/2005/08/addressing"));
-        assertNotNull(handler.getSchemaLocation("http://schemas.xmlsoap.org/ws/2004/08/addressing"));
-        assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/blueprint/core"));
-    }
-
-}


Mime
View raw message