Author: dkulp
Date: Thu Sep 14 14:19:54 2006
New Revision: 443474
URL: http://svn.apache.org/viewvc?view=rev&rev=443474
Log:
CXF-53 CXF-54
Remove dependencies on JAX-WS in http and JMS.
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
incubator/cxf/trunk/rt/transports/http/pom.xml
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitConfiguration.java
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java
incubator/cxf/trunk/rt/transports/jms/pom.xml
incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
Thu Sep 14 14:19:54 2006
@@ -41,8 +41,15 @@
String CORRELATION_OUT = "org.apache.cxf.correlation.out";
String CORRELATION_IN = "org.apache.cxf.correlation.in";
- String MTOM_ENABLED = "org.apache.cxf.isMtomEnabled";
-
+ String PROTOCOL_HEADERS = Message.class.getName() + ".PROTOCOL_HEADERS";
+ String RESPONSE_CODE = Message.class.getName() + ".RESPONSE_CODE";
+ String ENDPOINT_ADDRESS = Message.class.getName() + ".ENDPOINT_ADDRESS";
+ String HTTP_REQUEST_METHOD = Message.class.getName() +
".HTTP_REQUEST_METHOD";
+ String PATH_INFO = Message.class.getName() + ".PATH_INFO";
+ String QUERY_STRING = Message.class.getName() + ".QUERY_STRING";
+ String MTOM_ENABLED = Message.class.getName() + ".isMtomEnabled";
+
+
String getId();
InterceptorChain getInterceptorChain();
Modified: incubator/cxf/trunk/rt/transports/http/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/pom.xml?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/pom.xml (original)
+++ incubator/cxf/trunk/rt/transports/http/pom.xml Thu Sep 14 14:19:54 2006
@@ -70,14 +70,9 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
</dependency>
- <dependency>
- <groupId>javax.xml.ws</groupId>
- <artifactId>jaxws-api</artifactId>
- <scope>provided</scope>
- </dependency>
+
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
Modified:
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
---
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
(original)
+++
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
Thu Sep 14 14:19:54 2006
@@ -26,15 +26,11 @@
import java.util.Map;
import java.util.logging.Logger;
-import javax.xml.ws.BindingProvider;
-
-import static javax.xml.ws.handler.MessageContext.HTTP_REQUEST_HEADERS;
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_HEADERS;
-
import org.apache.cxf.Bus;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.Base64Exception;
import org.apache.cxf.common.util.Base64Utility;
+import org.apache.cxf.configuration.security.AuthorizationPolicy;
import org.apache.cxf.message.Message;
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.transport.ConduitInitiator;
@@ -122,7 +118,7 @@
protected void setHeaders(Message message) {
Map<String, List<String>> requestHeaders = new HashMap<String,
List<String>>();
copyRequestHeaders(message, requestHeaders);
- message.put(HTTP_REQUEST_HEADERS, requestHeaders);
+ message.put(Message.PROTOCOL_HEADERS, requestHeaders);
if (requestHeaders.containsKey("Authorization")) {
List<String> authorizationLines =
requestHeaders.get("Authorization");
@@ -135,17 +131,29 @@
String authInfo[] = authDecoded.split(":");
String username = authInfo[0];
String password = authInfo[1];
- message.put(BindingProvider.USERNAME_PROPERTY, username);
- message.put(BindingProvider.PASSWORD_PROPERTY, password);
+
+ AuthorizationPolicy policy = new AuthorizationPolicy();
+ policy.setUserName(username);
+ policy.setPassword(password);
+
+ message.put(AuthorizationPolicy.class, policy);
} catch (Base64Exception ex) {
//ignore, we'll leave things alone. They can try decoding
it themselves
}
}
}
-
- Map<String, List<String>> responseHeaders = new HashMap<String,
List<String>>();
+
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void updateResponseHeaders(Message message) {
+ Map<String, List<String>> responseHeaders =
+ (Map<String, List<String>>)message.get(Message.PROTOCOL_HEADERS);
+ if (responseHeaders == null) {
+ responseHeaders = new HashMap<String, List<String>>();
+ message.put(Message.PROTOCOL_HEADERS, responseHeaders);
+ }
config.setPolicies(responseHeaders);
- message.put(HTTP_RESPONSE_HEADERS, responseHeaders);
}
/**
Modified:
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
---
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Thu Sep 14 14:19:54 2006
@@ -34,11 +34,6 @@
import java.util.logging.Logger;
import javax.wsdl.WSDLException;
-import javax.xml.ws.BindingProvider;
-
-import static javax.xml.ws.handler.MessageContext.HTTP_REQUEST_HEADERS;
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_CODE;
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_HEADERS;
import org.apache.cxf.Bus;
import org.apache.cxf.common.logging.LogUtils;
@@ -154,7 +149,7 @@
public void send(Message message) throws IOException {
Map<String, List<String>> headers = setHeaders(message);
- String value =
(String)message.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+ String value = (String)message.get(Message.ENDPOINT_ADDRESS);
URL currentURL = value != null ? new URL(value) : url;
URLConnection connection =
@@ -292,10 +287,10 @@
*/
private Map<String, List<String>> setHeaders(Message message) {
Map<String, List<String>> headers =
- CastUtils.cast((Map<?, ?>)message.get(HTTP_REQUEST_HEADERS));
+ CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
if (null == headers) {
headers = new HashMap<String, List<String>>();
- message.put(HTTP_REQUEST_HEADERS, headers);
+ message.put(Message.PROTOCOL_HEADERS, headers);
}
return headers;
}
@@ -308,7 +303,7 @@
*/
protected void flushHeaders(Message message) throws IOException {
Map<String, List<String>> headers =
- CastUtils.cast((Map<?, ?>)message.get(HTTP_REQUEST_HEADERS));
+ CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
URLConnection connection = (URLConnection)message.get(HTTP_CONNECTION);
if (null != headers) {
for (String header : headers.keySet()) {
@@ -333,9 +328,9 @@
HttpURLConnection hc = (HttpURLConnection)connection;
responseCode = hc.getResponseCode();
} else {
- if (connection.getHeaderField(HTTP_RESPONSE_CODE) != null) {
+ if (connection.getHeaderField(Message.RESPONSE_CODE) != null) {
responseCode =
-
Integer.parseInt(connection.getHeaderField(HTTP_RESPONSE_CODE));
+
Integer.parseInt(connection.getHeaderField(Message.RESPONSE_CODE));
}
}
return responseCode;
@@ -420,8 +415,8 @@
Message inMessage = new MessageImpl();
inMessage.setExchange(exchange);
InputStream in = null;
- inMessage.put(HTTP_RESPONSE_HEADERS, connection.getHeaderFields());
- inMessage.put(HTTP_RESPONSE_CODE, getResponseCode(connection));
+ inMessage.put(Message.PROTOCOL_HEADERS,
connection.getHeaderFields());
+ inMessage.put(Message.RESPONSE_CODE, getResponseCode(connection));
if (connection instanceof HttpURLConnection) {
HttpURLConnection hc = (HttpURLConnection)connection;
in = hc.getErrorStream();
@@ -520,8 +515,8 @@
HttpRequest req,
HttpResponse resp) throws IOException {
Message inMessage = new MessageImpl();
- inMessage.put(HTTP_RESPONSE_HEADERS, req.getParameters());
- inMessage.put(HTTP_RESPONSE_CODE, HttpURLConnection.HTTP_OK);
+ inMessage.put(Message.PROTOCOL_HEADERS, req.getParameters());
+ inMessage.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK);
InputStream is = new WrapperInputStream(req, resp);
inMessage.setContent(InputStream.class, is);
Modified:
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitConfiguration.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitConfiguration.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
---
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitConfiguration.java
(original)
+++
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitConfiguration.java
Thu Sep 14 14:19:54 2006
@@ -25,8 +25,6 @@
import java.util.List;
import java.util.Map;
-import javax.xml.ws.BindingProvider;
-
import org.apache.cxf.Bus;
import org.apache.cxf.common.util.Base64Utility;
import org.apache.cxf.configuration.security.AuthorizationPolicy;
@@ -94,12 +92,17 @@
}
void setPolicies(Message message, Map<String, List<String>> headers) {
- String userName =
(String)message.get(BindingProvider.USERNAME_PROPERTY);
+ AuthorizationPolicy newPolicy = message.get(AuthorizationPolicy.class);
+ String userName = null;
+ String passwd = null;
+ if (null != newPolicy) {
+ userName = newPolicy.getUserName();
+ passwd = newPolicy.getPassword();
+ }
if (userName == null && authPolicy.isSetUserName()) {
userName = authPolicy.getUserName();
}
if (userName != null) {
- String passwd =
(String)message.get(BindingProvider.PASSWORD_PROPERTY);
if (passwd == null && authPolicy.isSetPassword()) {
passwd = authPolicy.getPassword();
}
@@ -120,7 +123,7 @@
if (proxyAuthPolicy.isSetUserName()) {
userName = proxyAuthPolicy.getUserName();
if (userName != null) {
- String passwd = "";
+ passwd = "";
if (proxyAuthPolicy.isSetPassword()) {
passwd = proxyAuthPolicy.getPassword();
}
Modified:
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
---
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
(original)
+++
incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
Thu Sep 14 14:19:54 2006
@@ -35,9 +35,6 @@
import javax.wsdl.Definition;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLWriter;
-import javax.xml.ws.handler.MessageContext;
-
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_CODE;
import org.apache.cxf.Bus;
import org.apache.cxf.message.Message;
@@ -167,7 +164,7 @@
} else {
if (partialResponse != null) {
// setup the outbound message to for 202 Accepted
- partialResponse.put(HTTP_RESPONSE_CODE,
+ partialResponse.put(Message.RESPONSE_CODE,
HttpURLConnection.HTTP_ACCEPTED);
backChannel = new BackChannelConduit(address, response);
} else {
@@ -228,7 +225,7 @@
* @param headers the current set of headers
*/
protected void copyResponseHeaders(Message message, HttpResponse response)
{
- Map<?, ?> headers = (Map<?,
?>)message.get(MessageContext.HTTP_RESPONSE_HEADERS);
+ Map<?, ?> headers = (Map<?, ?>)message.get(Message.PROTOCOL_HEADERS);
if (null != headers) {
for (Iterator<?> iter = headers.keySet().iterator();
iter.hasNext();) {
String header = (String)iter.next();
@@ -288,9 +285,9 @@
inMessage.setContent(InputStream.class, req.getInputStream());
inMessage.put(HTTP_REQUEST, req);
inMessage.put(HTTP_RESPONSE, resp);
- inMessage.put(MessageContext.HTTP_REQUEST_METHOD, req.getMethod());
- inMessage.put(MessageContext.PATH_INFO, req.getPath());
- inMessage.put(MessageContext.QUERY_STRING, req.getQuery());
+ inMessage.put(Message.HTTP_REQUEST_METHOD, req.getMethod());
+ inMessage.put(Message.PATH_INFO, req.getPath());
+ inMessage.put(Message.QUERY_STRING, req.getQuery());
setHeaders(inMessage);
@@ -308,12 +305,13 @@
}
protected OutputStream flushHeaders(Message outMessage) throws IOException
{
+ updateResponseHeaders(outMessage);
Object responseObj = outMessage.get(HTTP_RESPONSE);
OutputStream responseStream = null;
if (responseObj instanceof HttpResponse) {
HttpResponse response = (HttpResponse)responseObj;
- Integer i = (Integer)outMessage.get(HTTP_RESPONSE_CODE);
+ Integer i = (Integer)outMessage.get(Message.RESPONSE_CODE);
if (i != null) {
int status = i.intValue();
if (status == HttpURLConnection.HTTP_INTERNAL_ERROR) {
Modified:
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
---
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
(original)
+++
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
Thu Sep 14 14:19:54 2006
@@ -33,10 +33,6 @@
import java.util.List;
import java.util.Map;
-import static javax.xml.ws.handler.MessageContext.HTTP_REQUEST_HEADERS;
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_CODE;
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_HEADERS;
-
import junit.framework.TestCase;
import org.apache.cxf.helpers.CastUtils;
@@ -149,7 +145,7 @@
contentTypes.add("text/xml");
contentTypes.add("charset=utf8");
headers.put("content-type", contentTypes);
- message.put(HTTP_REQUEST_HEADERS, headers);
+ message.put(Message.PROTOCOL_HEADERS, headers);
}
private HTTPConduit setUpConduit(boolean send) throws Exception {
@@ -310,14 +306,14 @@
assertNotNull("expected in message", inMessage);
assertSame("unexpected response headers",
- inMessage.get(HTTP_RESPONSE_HEADERS),
+ inMessage.get(Message.PROTOCOL_HEADERS),
Collections.EMPTY_MAP);
Integer expectedResponseCode = decoupled
? HttpURLConnection.HTTP_ACCEPTED
: HttpURLConnection.HTTP_OK;
assertEquals("unexpected response code",
expectedResponseCode,
- inMessage.get(HTTP_RESPONSE_CODE));
+ inMessage.get(Message.RESPONSE_CODE));
assertTrue("unexpected content formats",
inMessage.getContentFormats().contains(InputStream.class));
assertSame("unexpected content", is,
inMessage.getContent(InputStream.class));
@@ -337,7 +333,7 @@
private OutputStream verifyRequestHeaders(Message message, boolean
expectHeaders)
throws IOException {
Map<String, List<String>> headers =
- CastUtils.cast((Map<?, ?>)message.get(HTTP_REQUEST_HEADERS));
+ CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
assertNotNull("expected request headers set", headers);
assertTrue("expected output stream format",
message.getContentFormats().contains(OutputStream.class));
@@ -370,7 +366,7 @@
((HttpURLConnection)connection).getErrorStream();
EasyMock.expectLastCall().andReturn(null);
} else {
- connection.getHeaderField(HTTP_RESPONSE_CODE);
+ connection.getHeaderField(Message.RESPONSE_CODE);
String responseString = Integer.toString(responseCode);
EasyMock.expectLastCall().andReturn(responseString).times(2);
}
@@ -392,10 +388,10 @@
decoupledResponse);
assertNotNull("expected decoupled in message", inMessage);
assertNotNull("expected response headers",
- inMessage.get(HTTP_RESPONSE_HEADERS));
+ inMessage.get(Message.PROTOCOL_HEADERS));
assertEquals("unexpected response code",
HttpURLConnection.HTTP_OK,
- inMessage.get(HTTP_RESPONSE_CODE));
+ inMessage.get(Message.RESPONSE_CODE));
assertEquals("unexpected getInputStream count",
1,
Modified:
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
---
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java
(original)
+++
incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java
Thu Sep 14 14:19:54 2006
@@ -26,20 +26,15 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.handler.MessageContext;
-
-import static javax.xml.ws.handler.MessageContext.HTTP_REQUEST_HEADERS;
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_CODE;
-import static javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_HEADERS;
-
import junit.framework.TestCase;
import org.apache.cxf.Bus;
import org.apache.cxf.common.util.Base64Utility;
+import org.apache.cxf.configuration.security.AuthorizationPolicy;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
@@ -113,7 +108,6 @@
os = null;
destination = null;
}
-
public void testGetAddress() throws Exception {
destination = setUpDestination();
EndpointReferenceType ref = destination.getAddress();
@@ -122,7 +116,6 @@
EndpointReferenceUtils.getAddress(ref),
EndpointReferenceUtils.getAddress(address));
}
-
public void testRemoveServant() throws Exception {
destination = setUpDestination();
setUpRemoveServant();
@@ -159,13 +152,13 @@
assertNotNull("unexpected null message", inMessage);
assertEquals("unexpected method",
- inMessage.get(MessageContext.HTTP_REQUEST_METHOD),
+ inMessage.get(Message.HTTP_REQUEST_METHOD),
"GET");
assertEquals("unexpected path",
- inMessage.get(MessageContext.PATH_INFO),
+ inMessage.get(Message.PATH_INFO),
"bar/foo");
assertEquals("unexpected query",
- inMessage.get(MessageContext.QUERY_STRING),
+ inMessage.get(Message.QUERY_STRING),
"?customerId=abc&cutomerAdd=def");
}
@@ -194,7 +187,6 @@
backChannel.send(outMessage);
verifyBackChannelSend(backChannel, outMessage, 200);
}
-
public void testGetBackChannelSendFault() throws Exception {
destination = setUpDestination(false);
setUpDoService(false, true);
@@ -205,6 +197,7 @@
backChannel.send(outMessage);
verifyBackChannelSend(backChannel, outMessage, 500);
}
+
public void testGetBackChannelSendOneway() throws Exception {
destination = setUpDestination(false);
@@ -228,7 +221,7 @@
destination.getBackChannel(inMessage, partialResponse, replyTo);
assertEquals("unexpected response code",
202,
- partialResponse.get(HTTP_RESPONSE_CODE));
+ partialResponse.get(Message.RESPONSE_CODE));
partialBackChannel.send(partialResponse);
verifyBackChannelSend(partialBackChannel, partialResponse, 202);
@@ -240,7 +233,7 @@
decoupledBackChannel);
fullBackChannel.send(outMessage);
}
-
+
private JettyHTTPDestination setUpDestination()
throws Exception {
return setUpDestination(false);
@@ -375,12 +368,13 @@
private Message setUpOutMessage() {
Message outMsg = new MessageImpl();
outMsg.putAll(inMessage);
+ outMsg.put(Message.PROTOCOL_HEADERS, new HashMap<String,
List<String>>());
return outMsg;
}
private void setUpResponseHeaders(Message outMsg) {
Map<String, List<String>> responseHeaders =
- CastUtils.cast((Map<?, ?>)outMsg.get(HTTP_RESPONSE_HEADERS));
+ CastUtils.cast((Map<?, ?>)outMsg.get(Message.PROTOCOL_HEADERS));
assertNotNull("expected response headers", responseHeaders);
List<String> challenges = new ArrayList<String>();
challenges.add(BASIC_CHALLENGE);
@@ -398,13 +392,13 @@
inMessage.get(JettyHTTPDestination.HTTP_RESPONSE),
response);
assertEquals("unexpected method",
- inMessage.get(MessageContext.HTTP_REQUEST_METHOD),
+ inMessage.get(Message.HTTP_REQUEST_METHOD),
"POST");
assertEquals("unexpected path",
- inMessage.get(MessageContext.PATH_INFO),
+ inMessage.get(Message.PATH_INFO),
"bar/foo");
assertEquals("unexpected query",
- inMessage.get(MessageContext.QUERY_STRING),
+ inMessage.get(Message.QUERY_STRING),
"?name");
verifyRequestHeaders();
@@ -428,7 +422,7 @@
private void verifyRequestHeaders() throws Exception {
Map<String, List<String>> requestHeaders =
- CastUtils.cast((Map<?, ?>)inMessage.get(HTTP_REQUEST_HEADERS));
+ CastUtils.cast((Map<?, ?>)inMessage.get(Message.PROTOCOL_HEADERS));
assertNotNull("expected request headers",
requestHeaders);
assertEquals("expected getFieldNames",
@@ -443,17 +437,20 @@
assertNotNull("expected field", values);
assertEquals("unexpected values", 1, values.size());
assertTrue("expected value", values.contains(BASIC_AUTH));
+
+ AuthorizationPolicy authpolicy =
inMessage.get(AuthorizationPolicy.class);
+ assertNotNull("Expected some auth tokens", policy);
assertEquals("expected user",
USER,
- inMessage.get(BindingProvider.USERNAME_PROPERTY));
+ authpolicy.getUserName());
assertEquals("expected passwd",
PASSWD,
- inMessage.get(BindingProvider.PASSWORD_PROPERTY));
+ authpolicy.getPassword());
}
private void verifyResponseHeaders(Message outMsg) throws Exception {
Map<String, List<String>> responseHeaders =
- CastUtils.cast((Map<?, ?>)outMsg.get(HTTP_RESPONSE_HEADERS));
+ CastUtils.cast((Map<?, ?>)outMsg.get(Message.PROTOCOL_HEADERS));
assertNotNull("expected response headers",
responseHeaders);
assertEquals("expected addField",
@@ -494,7 +491,7 @@
1,
response.getCommitCallCount());
- outMsg.put(HTTP_RESPONSE_CODE, status);
+ outMsg.put(Message.RESPONSE_CODE, status);
responseOS.write(PAYLOAD.getBytes());
setUpResponseHeaders(outMsg);
Modified: incubator/cxf/trunk/rt/transports/jms/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/pom.xml?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
--- incubator/cxf/trunk/rt/transports/jms/pom.xml (original)
+++ incubator/cxf/trunk/rt/transports/jms/pom.xml Thu Sep 14 14:19:54 2006
@@ -68,11 +68,6 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>javax.xml.ws</groupId>
- <artifactId>jaxws-api</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>javax.activation</groupId>
@@ -84,7 +79,6 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
<scope>test</scope>
</dependency>
Modified:
incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?view=diff&rev=443474&r1=443473&r2=443474
==============================================================================
---
incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
(original)
+++
incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
Thu Sep 14 14:19:54 2006
@@ -31,7 +31,6 @@
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import javax.xml.ws.handler.MessageContext;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.transports.jms.JMSAddressPolicyType;
@@ -79,41 +78,7 @@
env.setProperty(propertyPair.getName(),
propertyPair.getValue());
}
}
- }
-
- public static JMSMessageHeadersType populateIncomingContext(Message
message, MessageContext context,
- String headerType)
throws JMSException {
- JMSMessageHeadersType headers = null;
-
- headers = (JMSMessageHeadersType)context.get(headerType);
-
- if (headers == null) {
- headers = new JMSMessageHeadersType();
- context.put(headerType, headers);
- }
-
- headers.setJMSCorrelationID(message.getJMSCorrelationID());
- headers.setJMSDeliveryMode(new Integer(message.getJMSDeliveryMode()));
- headers.setJMSExpiration(new Long(message.getJMSExpiration()));
- headers.setJMSMessageID(message.getJMSMessageID());
- headers.setJMSPriority(new Integer(message.getJMSPriority()));
-
headers.setJMSRedelivered(Boolean.valueOf(message.getJMSRedelivered()));
- headers.setJMSTimeStamp(new Long(message.getJMSTimestamp()));
- headers.setJMSType(message.getJMSType());
-
- List<JMSPropertyType> props = headers.getProperty();
- Enumeration enm = message.getPropertyNames();
- while (enm.hasMoreElements()) {
- String name = (String)enm.nextElement();
- String val = message.getStringProperty(name);
- JMSPropertyType prop = new JMSPropertyType();
- prop.setName(name);
- prop.setValue(val);
- props.add(prop);
- }
-
- return headers;
- }
+ }
public static int getJMSDeliveryMode(JMSMessageHeadersType headers) {
int deliveryMode = Message.DEFAULT_DELIVERY_MODE;