Author: ningjiang
Date: Wed Nov 9 15:05:32 2011
New Revision: 1199784
URL: http://svn.apache.org/viewvc?rev=1199784&view=rev
Log:
CAMEL-4645 Enhancement of loggingFeature setting on CxfRsEndpoint
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java
camel/trunk/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd
camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointTest.java
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreeterEndpointBeans.xml
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java
Wed Nov 9 15:05:32 2011
@@ -16,7 +16,11 @@
*/
package org.apache.camel.component.cxf.blueprint;
+import java.util.List;
+
import org.apache.camel.RuntimeCamelException;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.container.BlueprintContainer;
@@ -24,6 +28,8 @@ import org.osgi.service.blueprint.contai
public class RsClientBlueprintBean extends JAXRSClientFactoryBean implements
BlueprintSupport, Cloneable {
private BlueprintContainer blueprintContainer;
private BundleContext bundleContext;
+ private boolean loggingFeatureEnabled;
+ private int loggingSizeLimit;
public BlueprintContainer getBlueprintContainer() {
return blueprintContainer;
@@ -40,5 +46,33 @@ public class RsClientBlueprintBean exten
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
+
+ public boolean isLoggingFeatureEnabled() {
+ return loggingFeatureEnabled;
+ }
+
+ public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
+ this.loggingFeatureEnabled = loggingFeatureEnabled;
+ }
+
+ public int getLoggingSizeLimit() {
+ return loggingSizeLimit;
+ }
+
+ public void setLoggingSizeLimit(int loggingSizeLimit) {
+ this.loggingSizeLimit = loggingSizeLimit;
+ }
+
+ public List<AbstractFeature> getFeatures() {
+ List<AbstractFeature> answer = super.getFeatures();
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.add(new LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.add(new LoggingFeature());
+ }
+ }
+ return answer;
+ }
}
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java
Wed Nov 9 15:05:32 2011
@@ -16,7 +16,11 @@
*/
package org.apache.camel.component.cxf.blueprint;
+import java.util.List;
+
import org.apache.camel.RuntimeCamelException;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.container.BlueprintContainer;
@@ -25,6 +29,8 @@ public class RsServerBlueprintBean exten
private BlueprintContainer blueprintContainer;
private BundleContext bundleContext;
+ private boolean loggingFeatureEnabled;
+ private int loggingSizeLimit;
public BlueprintContainer getBlueprintContainer() {
return blueprintContainer;
@@ -42,4 +48,32 @@ public class RsServerBlueprintBean exten
this.bundleContext = bundleContext;
}
+ public boolean isLoggingFeatureEnabled() {
+ return loggingFeatureEnabled;
+ }
+
+ public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
+ this.loggingFeatureEnabled = loggingFeatureEnabled;
+ }
+
+ public int getLoggingSizeLimit() {
+ return loggingSizeLimit;
+ }
+
+ public void setLoggingSizeLimit(int loggingSizeLimit) {
+ this.loggingSizeLimit = loggingSizeLimit;
+ }
+
+ public List<AbstractFeature> getFeatures() {
+ List<AbstractFeature> answer = super.getFeatures();
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.add(new LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.add(new LoggingFeature());
+ }
+ }
+ return answer;
+ }
+
}
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
Wed Nov 9 15:05:32 2011
@@ -72,6 +72,7 @@ public class CxfRsComponent extends Head
// endpoint URI does not specify a bean
answer = new CxfRsEndpoint(remaining, this);
}
+ setProperties(answer, parameters);
Map<String, String> params = CastUtils.cast(parameters);
answer.setParameters(params);
setEndpointHeaderFilterStrategy(answer);
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
Wed Nov 9 15:05:32 2011
@@ -33,6 +33,7 @@ import org.apache.camel.spi.HeaderFilter
import org.apache.camel.spi.HeaderFilterStrategyAware;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
@@ -52,6 +53,8 @@ public class CxfRsEndpoint extends Defau
private String address;
private boolean throwExceptionOnFailure = true;
private int maxClientCacheSize = 10;
+ private boolean loggingFeatureEnabled;
+ private int loggingSizeLimit;
private AtomicBoolean getBusHasBeenCalled = new AtomicBoolean(false);
@@ -146,6 +149,13 @@ public class CxfRsEndpoint extends Defau
if (getResourceClasses() != null) {
cfb.setResourceClass(getResourceClasses().get(0));
}
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ cfb.getFeatures().add(new
LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ cfb.getFeatures().add(new LoggingFeature());
+ }
+ }
cfb.setThreadSafe(true);
}
@@ -160,6 +170,13 @@ public class CxfRsEndpoint extends Defau
public JAXRSServerFactoryBean createJAXRSServerFactoryBean() {
JAXRSServerFactoryBean answer = newJAXRSServerFactoryBean();
setupJAXRSServerFactoryBean(answer);
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.getFeatures().add(new
LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.getFeatures().add(new LoggingFeature());
+ }
+ }
return answer;
}
@@ -171,6 +188,13 @@ public class CxfRsEndpoint extends Defau
public JAXRSClientFactoryBean createJAXRSClientFactoryBean(String address)
{
JAXRSClientFactoryBean answer = newJAXRSClientFactoryBean();
setupJAXRSClientFactoryBean(answer, address);
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.getFeatures().add(new
LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.getFeatures().add(new LoggingFeature());
+ }
+ }
return answer;
}
@@ -194,6 +218,22 @@ public class CxfRsEndpoint extends Defau
return address;
}
+ public boolean isLoggingFeatureEnabled() {
+ return loggingFeatureEnabled;
+ }
+
+ public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
+ this.loggingFeatureEnabled = loggingFeatureEnabled;
+ }
+
+ public int getLoggingSizeLimit() {
+ return loggingSizeLimit;
+ }
+
+ public void setLoggingSizeLimit(int loggingSizeLimit) {
+ this.loggingSizeLimit = loggingSizeLimit;
+ }
+
public boolean isThrowExceptionOnFailure() {
return throwExceptionOnFailure;
}
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java
Wed Nov 9 15:05:32 2011
@@ -22,6 +22,8 @@ import org.apache.camel.component.cxf.ja
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
import org.apache.cxf.version.Version;
import org.springframework.beans.BeansException;
@@ -31,11 +33,29 @@ import org.springframework.context.Appli
public class SpringJAXRSClientFactoryBean extends JAXRSClientFactoryBean
implements ApplicationContextAware, BeanIdAware {
private String beanId;
+ private boolean loggingFeatureEnabled;
+ private int loggingSizeLimit;
public SpringJAXRSClientFactoryBean() {
super();
}
+ public boolean isLoggingFeatureEnabled() {
+ return loggingFeatureEnabled;
+ }
+
+ public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
+ this.loggingFeatureEnabled = loggingFeatureEnabled;
+ }
+
+ public int getLoggingSizeLimit() {
+ return loggingSizeLimit;
+ }
+
+ public void setLoggingSizeLimit(int loggingSizeLimit) {
+ this.loggingSizeLimit = loggingSizeLimit;
+ }
+
@SuppressWarnings("deprecation")
@Override
public void setApplicationContext(ApplicationContext ctx) throws
BeansException {
@@ -64,4 +84,16 @@ public class SpringJAXRSClientFactoryBea
List<String> getSchemaLocations() {
return schemaLocations;
}
+
+ public List<AbstractFeature> getFeatures() {
+ List<AbstractFeature> answer = super.getFeatures();
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.add(new LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.add(new LoggingFeature());
+ }
+ }
+ return answer;
+ }
}
\ No newline at end of file
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java
Wed Nov 9 15:05:32 2011
@@ -22,6 +22,8 @@ import org.apache.camel.component.cxf.ja
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
import org.apache.cxf.version.Version;
@@ -32,6 +34,8 @@ import org.springframework.context.Appli
public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean
implements
ApplicationContextAware, BeanIdAware {
private String beanId;
+ private boolean loggingFeatureEnabled;
+ private int loggingSizeLimit;
public SpringJAXRSServerFactoryBean() {
super();
@@ -73,4 +77,32 @@ public class SpringJAXRSServerFactoryBea
List<String> getSchemaLocations() {
return schemaLocations;
}
+
+ public boolean isLoggingFeatureEnabled() {
+ return loggingFeatureEnabled;
+ }
+
+ public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
+ this.loggingFeatureEnabled = loggingFeatureEnabled;
+ }
+
+ public int getLoggingSizeLimit() {
+ return loggingSizeLimit;
+ }
+
+ public void setLoggingSizeLimit(int loggingSizeLimit) {
+ this.loggingSizeLimit = loggingSizeLimit;
+ }
+
+ public List<AbstractFeature> getFeatures() {
+ List<AbstractFeature> answer = super.getFeatures();
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.add(new LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.add(new LoggingFeature());
+ }
+ }
+ return answer;
+ }
}
\ No newline at end of file
Modified:
camel/trunk/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd
(original)
+++
camel/trunk/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd
Wed Nov 9 15:05:32 2011
@@ -57,7 +57,7 @@
<xsd:attribute name="wsdlURL" type="xsd:string"/>
<xsd:attribute name="endpointName" type="xsd:QName"/>
<xsd:attribute name="serviceName" type="xsd:QName"/>
- <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"
default="false"/>
+ <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/>
<xsd:attribute name="loggingSizeLimit" type="xsd:integer" />
</xsd:extension>
</xsd:complexContent>
@@ -94,6 +94,8 @@
<xsd:attribute name="modelRef" type="xsd:string"/>
<xsd:attribute name="bindingId" type="xsd:string"/>
<xsd:attribute name="staticSubresourceResolution"
type="xsd:boolean"/>
+ <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/>
+ <xsd:attribute name="loggingSizeLimit" type="xsd:integer" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -128,6 +130,8 @@
<xsd:attribute name="modelRef" type="xsd:string"/>
<xsd:attribute name="username" type="xsd:string"/>
<xsd:attribute name="password" type="xsd:string"/>
+ <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/>
+ <xsd:attribute name="loggingSizeLimit" type="xsd:integer" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Modified:
camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd
(original)
+++ camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd
Wed Nov 9 15:05:32 2011
@@ -55,7 +55,7 @@
<xsd:attribute name="wsdlURL" type="xsd:string" />
<xsd:attribute name="endpointName" type="xsd:string" />
<xsd:attribute name="serviceName" type="xsd:string" />
- <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"
default="false"/>
+ <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/>
<xsd:attribute name="loggingSizeLimit" type="xsd:integer" />
</xsd:extension>
</xsd:complexContent>
@@ -92,6 +92,8 @@
<xsd:attribute name="modelRef" type="xsd:string" />
<xsd:attribute name="bindingId" type="xsd:string" />
<xsd:attribute name="staticSubresourceResolution" type="xsd:boolean"
/>
+ <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/>
+ <xsd:attribute name="loggingSizeLimit" type="xsd:integer" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -126,6 +128,8 @@
<xsd:attribute name="modelRef" type="xsd:string" />
<xsd:attribute name="username" type="xsd:string"/>
<xsd:attribute name="password" type="xsd:string"/>
+ <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/>
+ <xsd:attribute name="loggingSizeLimit" type="xsd:integer" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Modified:
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointTest.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointTest.java
(original)
+++
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointTest.java
Wed Nov 9 15:05:32 2011
@@ -27,8 +27,10 @@ public class CxfRsEndpointTest extends C
@Test
public void testCreateCxfRsEndpoint() throws Exception {
String endpointUri = "cxfrs://http://localhost:" + CTX + ""
- +
"?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerService,"
+ + "?loggingFeatureEnabled=true&loggingSizeLimit=200"
+ +
"&resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerService,"
+
"java.lang.String;org.apache.camel.component.cxf.jaxrs.testbean.Order";
+
CxfRsComponent component = new CxfRsComponent(context);
CxfRsEndpoint endpoint =
(CxfRsEndpoint)component.createEndpoint(endpointUri);
@@ -36,15 +38,18 @@ public class CxfRsEndpointTest extends C
assertEquals("Get a wrong address ", endpointUri,
endpoint.getEndpointUri());
assertEquals("Get a wrong size of resouces classes", 3,
endpoint.getResourceClasses().size());
assertEquals("Get a wrong resources class", CustomerService.class,
endpoint.getResourceClasses().get(0));
+ assertEquals("Get a wrong loggingFeatureEnabled setting", true,
endpoint.isLoggingFeatureEnabled());
+ assertEquals("Get a wrong loggingSizeLimit setting", 200,
endpoint.getLoggingSizeLimit());
}
@Test
public void testCxfRsEndpointParameters() throws Exception {
CxfRsComponent component = new CxfRsComponent(context);
- CxfRsEndpoint endpoint =
(CxfRsEndpoint)component.createEndpoint("cxfrs://http://localhost:" + CTX +
"/templatetest/TID/ranges/start=0;end=1?"
- + "httpClientAPI=true&q1=11&q2=12");
+ String endpointUri = "cxfrs://http://localhost:" + CTX +
"/templatetest/TID/ranges/start=0;end=1?"
+ +
"httpClientAPI=true&loggingFeatureEnabled=true&loggingSizeLimit=200&q1=11&q2=12";
+ CxfRsEndpoint endpoint =
(CxfRsEndpoint)component.createEndpoint(endpointUri);
- assertEquals("Get a wrong URI ", "cxfrs://http://localhost:" + CTX +
"/templatetest/TID/ranges/start=0;end=1?httpClientAPI=true&q1=11&q2=12",
endpoint.getEndpointUri());
+ assertEquals("Get a wrong URI ", endpointUri,
endpoint.getEndpointUri());
assertEquals("Get a wrong usingClientAPI option", true,
endpoint.isHttpClientAPI());
assertNotNull("The Parameter should not be null" +
endpoint.getParameters());
assertEquals("Get a wrong parameter map", "{q1=11, q2=12}",
endpoint.getParameters().toString());
Modified:
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
(original)
+++
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
Wed Nov 9 15:05:32 2011
@@ -35,6 +35,8 @@ public class CxfRsSpringEndpointTest ext
assertEquals("Get a wrong address", sfb.getAddress(),
"http://localhost:9000/router");
assertEquals("Get a wrong size of resource classess",
sfb.getResourceClasses().size(), 1);
assertEquals("Get a wrong resource class",
sfb.getResourceClasses().get(0), CustomerService.class);
+ assertEquals("Got the wrong loggingFeatureEnabled", true,
sfb.isLoggingFeatureEnabled());
+ assertEquals("Got the wrong loggingSizeLimit", 200,
sfb.getLoggingSizeLimit());
}
@Test
@@ -44,6 +46,8 @@ public class CxfRsSpringEndpointTest ext
assertEquals("Get a wrong beanId", cfb.getBeanId(), "rsClient");
assertEquals("Get a wrong address", cfb.getAddress(),
"http://localhost:9002/helloworld");
assertTrue("Get a wrong resource class instance", cfb.create()
instanceof CustomerService);
+ assertEquals("Got the wrong loggingFeatureEnabled", false,
cfb.isLoggingFeatureEnabled());
+ assertEquals("Got the wrong loggingSizeLimit", 0,
cfb.getLoggingSizeLimit());
}
@Override
Modified:
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java
(original)
+++
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java
Wed Nov 9 15:05:32 2011
@@ -39,6 +39,8 @@ public class CxfRsClientFactoryBeanTest
assertNotNull("The customer service should not be null",
customerService);
assertEquals("Got the wrong schemalocations size", 1,
cfb.getSchemaLocations().size());
assertEquals("Got the wrong schemalocation",
"classpath:wsdl/Message.xsd", cfb.getSchemaLocations().get(0));
+ assertEquals("Got the wrong loggingFeatureEnabled", true,
cfb.isLoggingFeatureEnabled());
+ assertEquals("Got the wrong loggingSizeLimit", 200,
cfb.getLoggingSizeLimit());
}
}
Modified:
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreeterEndpointBeans.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreeterEndpointBeans.xml?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreeterEndpointBeans.xml
(original)
+++
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreeterEndpointBeans.xml
Wed Nov 9 15:05:32 2011
@@ -32,10 +32,8 @@
<cxf:cxfEndpoint id="routerEndpoint"
address="http://localhost:${CXFTestSupport.port2}/CxfGreeterMessageRouterTest/CamelContext/RouterPort"
- serviceClass="org.apache.hello_world_soap_http.GreeterImpl">
- <cxf:features>
- <bean class="org.apache.cxf.feature.LoggingFeature"/>
- </cxf:features>
+ serviceClass="org.apache.hello_world_soap_http.GreeterImpl"
+ loggingFeatureEnabled="true">
</cxf:cxfEndpoint>
<cxf:cxfEndpoint id="serviceEndpoint"
address="http://localhost:${CXFTestSupport.port1}/CxfGreeterMessageRouterTest/SoapContext/SoapPort"
@@ -44,9 +42,7 @@
endpointName="s:SoapPort"
serviceName="s:SOAPService"
xmlns:s="http://apache.org/hello_world_soap_http" >
- <cxf:features>
- <bean class="org.apache.cxf.feature.LoggingFeature"/>
- </cxf:features>
+
</cxf:cxfEndpoint>
</beans>
\ No newline at end of file
Modified:
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
(original)
+++
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
Wed Nov 9 15:05:32 2011
@@ -26,7 +26,8 @@
<cxf:rsServer id="rsServer" address="http://localhost:9000/router"
-
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService">
+
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
+ loggingFeatureEnabled="true" loggingSizeLimit="200">
<cxf:providers>
<ref bean="jsonProvider"/>
</cxf:providers>
Modified:
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
(original)
+++
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
Wed Nov 9 15:05:32 2011
@@ -44,11 +44,13 @@
<!-- Defined the server endpoint to create the cxf-rs consumer -->
<cxf:rsServer id="rsServer"
address="http://localhost:${CXFTestSupport.port1}/CxfRsRouterTest/route"
-
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" />
+
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
+ loggingFeatureEnabled="true" loggingSizeLimit="20"/>
<!-- Defined the client endpoint to create the cxf-rs consumer -->
<cxf:rsClient id="rsClient"
address="http://localhost:${CXFTestSupport.port2}/CxfRsRouterTest/rest"
-
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"/>
+
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
+ loggingFeatureEnabled="true" />
<!-- The camel route context -->
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
Modified:
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml?rev=1199784&r1=1199783&r2=1199784&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml
(original)
+++
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml
Wed Nov 9 15:05:32 2011
@@ -27,7 +27,8 @@
<cxf:rsClient id="rsClient1"
address="http://localhost:${CXFTestSupport.port1}/CxfRsClientFactoryBeanTest/router"
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
- username="username" password="passwd" >
+ username="username" password="passwd"
+ loggingFeatureEnabled="true" loggingSizeLimit="200">
<cxf:schemaLocations>
<cxf:schemaLocation>classpath:wsdl/Message.xsd</cxf:schemaLocation>
</cxf:schemaLocations>