Author: ningjiang
Date: Wed Feb 10 16:05:38 2010
New Revision: 908559
URL: http://svn.apache.org/viewvc?rev=908559&view=rev
Log:
Merged revisions 908549 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r908549 | ningjiang | 2010-02-10 23:46:51 +0800 (Wed, 10 Feb 2010) | 1 line
CXF-2667 bus configure should provides bus attribute to set the bus
........
Added:
cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus.xml
- copied unchanged from r908549,
cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus.xml
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
cxf/branches/2.2.x-fixes/rt/core/src/main/resources/schemas/core.xsd
cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
svn:mergeinfo = /cxf/trunk:908549
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java?rev=908559&r1=908558&r2=908559&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
Wed Feb 10 16:05:38 2010
@@ -47,11 +47,12 @@
setBeanClass(BusConfig.class);
}
protected void doParse(Element element, ParserContext ctx,
BeanDefinitionBuilder bean) {
- String bus = element.getAttribute("bus");
+ String bus = element.getAttribute("bus");
if (StringUtils.isEmpty(bus)) {
addBusWiringAttribute(bean, BusWiringType.CONSTRUCTOR);
} else {
bean.addConstructorArgReference(bus);
+ element.removeAttribute("bus");
}
super.doParse(element, ctx, bean);
}
Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/resources/schemas/core.xsd
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/resources/schemas/core.xsd?rev=908559&r1=908558&r2=908559&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/resources/schemas/core.xsd
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/resources/schemas/core.xsd Wed
Feb 10 16:05:38 2010
@@ -116,7 +116,8 @@
</xsd:annotation>
</xsd:element>
</xsd:all>
- <xsd:attributeGroup ref="cxf-beans:beanAttributes"/>
+ <xsd:attributeGroup ref="cxf-beans:beanAttributes"/>
+ <xsd:attribute name="bus" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:schema>
Modified:
cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java?rev=908559&r1=908558&r2=908559&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
Wed Feb 10 16:05:38 2010
@@ -32,6 +32,8 @@
import org.junit.Assert;
import org.junit.Test;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
public class BusDefinitionParserTest extends Assert {
@Test
@@ -63,6 +65,26 @@
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();
+ }
+ }
+ }
+
static class TestBean {
boolean initialised;