commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject svn commit: r348000 - /jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestJaxRpcProvider.java
Date Mon, 21 Nov 2005 22:01:35 GMT
Author: jcarman
Date: Mon Nov 21 14:01:33 2005
New Revision: 348000

URL: http://svn.apache.org/viewcvs?rev=348000&view=rev
Log:
Improving test coverage.

Modified:
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestJaxRpcProvider.java

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestJaxRpcProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestJaxRpcProvider.java?rev=348000&r1=347999&r2=348000&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestJaxRpcProvider.java
(original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestJaxRpcProvider.java
Mon Nov 21 14:01:33 2005
@@ -14,20 +14,57 @@
  *  limitations under the License.
  */
 package org.apache.commons.proxy.provider;
+
 import junit.framework.TestCase;
+import org.apache.commons.proxy.exception.ObjectProviderException;
 import org.apache.commons.proxy.util.QuoteService;
 
+import java.net.MalformedURLException;
+
 public class TestJaxRpcProvider extends TestCase
 {
     public void testGetObject() throws Exception
     {
         final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class );
         provider.setWsdlUrl( "http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl"
);
-        provider.setServiceNamespaceUri( "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/"
);
+        provider.setServiceNamespaceUri(
+                "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/"
);
+        provider.setServiceLocalPart( "net.xmethods.services.stockquote.StockQuoteService"
);
+        provider.setServicePrefix( "" );
+        provider.setPortNamespaceUri(
+                "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/"
);
+        provider.setPortLocalPart( "net.xmethods.services.stockquote.StockQuotePort" );
+        provider.setPortPrefix( "" );
+        final QuoteService quote = ( QuoteService ) provider.getObject();
+        assertNotNull( quote );
+    }
+
+    public void testGetObjectWithoutPrefix() throws Exception
+    {
+        final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class );
+        provider.setWsdlUrl( "http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl"
);
+        provider.setServiceNamespaceUri(
+                "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/"
);
         provider.setServiceLocalPart( "net.xmethods.services.stockquote.StockQuoteService"
);
-        provider.setPortNamespaceUri( "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/"
);
+        provider.setPortNamespaceUri(
+                "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/"
);
         provider.setPortLocalPart( "net.xmethods.services.stockquote.StockQuotePort" );
-        final QuoteService quote = ( QuoteService )provider.getObject();
+        final QuoteService quote = ( QuoteService ) provider.getObject();
         assertNotNull( quote );
+    }
+
+    public void testGetObjectWithInvalidUrl() throws Exception
+    {
+        final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class );
+        provider.setWsdlUrl( "yadda yadda yadda" );
+        try
+        {
+            final QuoteService quote = ( QuoteService ) provider.getObject();
+            fail();
+        }
+        catch( ObjectProviderException e )
+        {
+            assertTrue( e.getCause() instanceof MalformedURLException );
+        }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message