You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2008/06/23 17:54:07 UTC
svn commit: r670662 - in
/servicemix/sandbox/chirino/smx3-trunk-component-splitout: ./
core/servicemix-core/src/main/java/org/apache/servicemix/components/util/
core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/
core/servicemix-core/src...
Author: chirino
Date: Mon Jun 23 08:54:06 2008
New Revision: 670662
URL: http://svn.apache.org/viewvc?rev=670662&view=rev
Log:
Merged revisions 669281,669381,669425,669708,670459,670558 via svnmerge from
https://svn.apache.org/repos/asf/servicemix/smx3/trunk
........
r669281 | gnodet | 2008-06-18 16:22:52 -0400 (Wed, 18 Jun 2008) | 1 line
Fix cxf-se test to send back the done status
........
r669381 | ffang | 2008-06-19 00:03:51 -0400 (Thu, 19 Jun 2008) | 1 line
[SM-1400]cxf bc consumer should be able to retrieve wsdl from internal endpoint of JBI bus if there is one
........
r669425 | ffang | 2008-06-19 04:34:16 -0400 (Thu, 19 Jun 2008) | 1 line
[SM-1413]test to verify both send and sendSync can work with cxf bc provider using jms transport identically
........
r669708 | gnodet | 2008-06-19 17:41:10 -0400 (Thu, 19 Jun 2008) | 1 line
Fix test compilation problem
........
r670459 | gertv | 2008-06-23 03:32:08 -0400 (Mon, 23 Jun 2008) | 1 line
SM-1415: Allow to specify encoding on default marshaler
........
r670558 | kkoehler | 2008-06-23 09:21:07 -0400 (Mon, 23 Jun 2008) | 3 lines
patch for SM-1417. "A failing EIPTransactionalTest causes some more tests to fail..."
added simple try/finally block
........
Added:
servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java
- copied unchanged from r670558, servicemix/smx3/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java
Modified:
servicemix/sandbox/chirino/smx3-trunk-component-splitout/ (props changed)
servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java
servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/SourceTransformer.java
servicemix/sandbox/chirino/smx3-trunk-component-splitout/servicemix-itests/src/test/java/org/apache/servicemix/itests/WSNComponentTest.java
Propchange: servicemix/sandbox/chirino/smx3-trunk-component-splitout/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jun 23 08:54:06 2008
@@ -1 +1 @@
-/servicemix/smx3/trunk:1-669199
+/servicemix/smx3/trunk:1-670661
Modified: servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java?rev=670662&r1=670661&r2=670662&view=diff
==============================================================================
--- servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java (original)
+++ servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java Mon Jun 23 08:54:06 2008
@@ -19,9 +19,11 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
+import java.nio.charset.Charset;
import javax.jbi.JBIException;
import javax.jbi.messaging.MessageExchange;
@@ -54,10 +56,15 @@
private Expression fileName = FILE_NAME_EXPRESSION;
private Expression content = FILE_CONTENT_EXPRESSION;
+ private String encoding;
public void readMessage(MessageExchange exchange, NormalizedMessage message,
InputStream in, String path) throws IOException, JBIException {
- message.setContent(new StreamSource(in, path));
+ if (encoding == null) {
+ message.setContent(new StreamSource(in, path));
+ } else {
+ message.setContent(new StreamSource(new InputStreamReader(in, Charset.forName(encoding)), path));
+ }
message.setProperty(FILE_NAME_PROPERTY, new File(path).getName());
message.setProperty(FILE_PATH_PROPERTY, path);
}
@@ -97,6 +104,14 @@
public void setFileName(Expression fileName) {
this.fileName = fileName;
}
+
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ public String getEncoding() {
+ return encoding;
+ }
// Implementation methods
//-------------------------------------------------------------------------
@@ -134,9 +149,10 @@
throw new NoMessageContentAvailableException(exchange);
}
try {
- getTransformer().toResult(src, new StreamResult(out));
+ getTransformer().toResult(src, new StreamResult(out), encoding);
} catch (TransformerException e) {
throw new MessagingException(e);
}
}
+
}
Modified: servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/SourceTransformer.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/SourceTransformer.java?rev=670662&r1=670661&r2=670662&view=diff
==============================================================================
--- servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/SourceTransformer.java (original)
+++ servicemix/sandbox/chirino/smx3-trunk-component-splitout/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/SourceTransformer.java Mon Jun 23 08:54:06 2008
@@ -97,17 +97,31 @@
}
/**
- * Converts the given input Source into the required result
+ * Converts the given input Source into the required result, using the default charset
*/
public void toResult(Source source, Result result) throws TransformerException {
+ toResult(source, result, defaultCharset);
+ }
+
+ /**
+ * Converts the given input Source into the required result, using the specified encoding
+ * @param source the input Source
+ * @param result the output Result
+ * @param charset the required charset, if you specify <code>null</code> the default charset will be used
+ */
+ public void toResult(Source source, Result result, String charset)
+ throws TransformerConfigurationException, TransformerException {
if (source == null) {
return;
}
+ if (charset == null) {
+ charset = defaultCharset;
+ }
Transformer transformer = createTransfomer();
if (transformer == null) {
throw new TransformerException("Could not create a transformer - JAXP is misconfigured!");
}
- transformer.setOutputProperty(OutputKeys.ENCODING, defaultCharset);
+ transformer.setOutputProperty(OutputKeys.ENCODING, charset);
transformer.transform(source, result);
}
Modified: servicemix/sandbox/chirino/smx3-trunk-component-splitout/servicemix-itests/src/test/java/org/apache/servicemix/itests/WSNComponentTest.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/chirino/smx3-trunk-component-splitout/servicemix-itests/src/test/java/org/apache/servicemix/itests/WSNComponentTest.java?rev=670662&r1=670661&r2=670662&view=diff
==============================================================================
--- servicemix/sandbox/chirino/smx3-trunk-component-splitout/servicemix-itests/src/test/java/org/apache/servicemix/itests/WSNComponentTest.java (original)
+++ servicemix/sandbox/chirino/smx3-trunk-component-splitout/servicemix-itests/src/test/java/org/apache/servicemix/itests/WSNComponentTest.java Mon Jun 23 08:54:06 2008
@@ -20,6 +20,8 @@
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
import junit.framework.TestCase;
@@ -33,9 +35,8 @@
import org.apache.servicemix.soap.SoapHelper;
import org.apache.servicemix.tck.ReceiverComponent;
import org.apache.servicemix.wsn.client.NotificationBroker;
+import org.apache.servicemix.wsn.client.AbstractWSAClient;
import org.apache.servicemix.wsn.component.WSNComponent;
-import org.w3._2005._08.addressing.AttributedURIType;
-import org.w3._2005._08.addressing.EndpointReferenceType;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
@@ -92,6 +93,7 @@
HttpEndpoint httpReceiver = new HttpEndpoint();
httpReceiver.setService(new QName("receiver"));
httpReceiver.setEndpoint("endpoint");
+ httpReceiver.setRoleAsString("consumer");
httpReceiver.setLocationURI("http://localhost:8192/Receiver/");
httpReceiver.setDefaultMep(SoapHelper.IN_ONLY);
httpReceiver.setSoap(true);
@@ -104,9 +106,7 @@
receiver.setEndpoint("endpoint");
jbi.activateComponent(new ActivationSpec("receiver", receiver));
- EndpointReferenceType epr = new EndpointReferenceType();
- epr.setAddress(new AttributedURIType());
- epr.getAddress().setValue("http://localhost:8192/Receiver/?http.soap=true");
+ W3CEndpointReference epr = AbstractWSAClient.createWSA("http://localhost:8192/Receiver/?http.soap=true");
wsnBroker.subscribe(epr, "myTopic", null);
wsnBroker.notify("myTopic", parse("<hello>world</hello>"));