[teiid-commits] teiid SVN: r3674 - in branches/7.6.x/connectors/connector-ws/src: main/java/org/teiid/resource/adapter/ws and 8 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Nov 18 16:31:47 EST 2011


Author: shawkins
Date: 2011-11-18 16:31:46 -0500 (Fri, 18 Nov 2011)
New Revision: 3674

Added:
   branches/7.6.x/connectors/connector-ws/src/test/
   branches/7.6.x/connectors/connector-ws/src/test/java/
   branches/7.6.x/connectors/connector-ws/src/test/java/org/
   branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/
   branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/
   branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/adapter/
   branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/adapter/ws/
   branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/adapter/ws/TestWSAdapter.java
Modified:
   branches/7.6.x/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java
   branches/7.6.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
Log:
TEIID-1836 adding a null check to avoid a cxf npe

Modified: branches/7.6.x/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java
===================================================================
--- branches/7.6.x/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java	2011-11-18 20:03:35 UTC (rev 3673)
+++ branches/7.6.x/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java	2011-11-18 21:31:46 UTC (rev 3674)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
 package org.teiid.resource.adapter.ws;
 
 import java.io.IOException;
@@ -212,6 +234,9 @@
 			}
 		} else {
 			endpoint = mcf.getEndPoint();
+			if (endpoint == null) {
+				throw new WebServiceException(WSManagedConnectionFactory.UTIL.getString("null_endpoint")); //$NON-NLS-1$
+			}
 		}
 		Dispatch<T> dispatch = null;
 		if (HTTPBinding.HTTP_BINDING.equals(binding) && type == DataSource.class) {

Modified: branches/7.6.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
===================================================================
--- branches/7.6.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties	2011-11-18 20:03:35 UTC (rev 3673)
+++ branches/7.6.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties	2011-11-18 21:31:46 UTC (rev 3674)
@@ -20,3 +20,4 @@
 # 02110-1301 USA.
 #
 
+null_endpoint=An endpoint must be specified by the procedure call or have a default value set by the EndPoint datasource property. 
\ No newline at end of file

Added: branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/adapter/ws/TestWSAdapter.java
===================================================================
--- branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/adapter/ws/TestWSAdapter.java	                        (rev 0)
+++ branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/adapter/ws/TestWSAdapter.java	2011-11-18 21:31:46 UTC (rev 3674)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.resource.adapter.ws;
+
+import javax.resource.ResourceException;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.junit.Test;
+
+public class TestWSAdapter {
+	
+	@Test(expected=WebServiceException.class) public void testMissingBinding() throws ResourceException {
+		WSManagedConnectionFactory wsmcf = new WSManagedConnectionFactory();
+		
+		WSConnectionImpl conn = (WSConnectionImpl)wsmcf.createConnectionFactory().getConnection();
+		conn.createDispatch(HTTPBinding.HTTP_BINDING, null, StreamSource.class, Mode.PAYLOAD);
+	}
+
+}


Property changes on: branches/7.6.x/connectors/connector-ws/src/test/java/org/teiid/resource/adapter/ws/TestWSAdapter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the teiid-commits mailing list