Author: jcarman Date: Tue Nov 22 04:59:13 2005 New Revision: 348162 URL: http://svn.apache.org/viewcvs?rev=348162&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=348162&r1=348161&r2=348162&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 Tue Nov 22 04:59:13 2005 @@ -39,6 +39,45 @@ assertNotNull( quote ); } + public void testGetObjectWithUnspecifiedPort() 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.setServicePrefix( "" ); + try + { + provider.getObject(); + fail(); + } + catch( ObjectProviderException e ) + { + } + } + + public void testGetObjectWithoutWsdl() throws Exception + { + final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class ); + 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( "" ); + try + { + provider.getObject(); + fail(); + } + catch( ObjectProviderException e ) + { + } + } + public void testGetObjectWithoutPrefix() throws Exception { final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class ); @@ -53,13 +92,61 @@ assertNotNull( quote ); } + public void testGetObjectWithoutPrefixOrNamespaceUri() throws Exception + { + final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class ); + provider.setWsdlUrl( "http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl" ); + provider.setServiceLocalPart( "net.xmethods.services.stockquote.StockQuoteService" ); + provider.setPortLocalPart( "net.xmethods.services.stockquote.StockQuotePort" ); + try + { + provider.getObject(); + fail(); + } + catch( ObjectProviderException e ) + { + } + } + + public void testGetObjectWithJustWsdl() + { + final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class ); + provider.setWsdlUrl( "http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl" ); + try + { + provider.getObject(); + fail(); + } + catch( ObjectProviderException e ) + { + } + } + + public void testGetObjectWithoutPrefixOrLocalPart() 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.setPortNamespaceUri( + "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/" ); + try + { + provider.getObject(); + fail(); + } + catch( ObjectProviderException e ) + { + } + } + public void testGetObjectWithInvalidUrl() throws Exception { final JaxRpcProvider provider = new JaxRpcProvider( QuoteService.class ); provider.setWsdlUrl( "yadda yadda yadda" ); try { - final QuoteService quote = ( QuoteService ) provider.getObject(); + provider.getObject(); fail(); } catch( ObjectProviderException e ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]