From: <bov...@us...> - 2007-02-21 21:14:14
|
Revision: 1361 http://svn.sourceforge.net/pywebsvcs/?rev=1361&view=rev Author: boverhof Date: 2007-02-21 13:14:10 -0800 (Wed, 21 Feb 2007) Log Message: ----------- M test/wsdl2py/config.txt A test/wsdl2py/test_WSDLImport.py A test/wsdl2py/test_WSDLImport2.wsdl A test/wsdl2py/test_WSDLImport.wsdl M ZSI/generate/commands.py M CHANGES -- print stacktrace to stderr when exiting so user has a clue what might have happened. -- added a couple unittests for testing wsdl:import, WSDL donated by Pavel. Modified Paths: -------------- trunk/zsi/CHANGES trunk/zsi/ZSI/generate/commands.py trunk/zsi/test/wsdl2py/config.txt Added Paths: ----------- trunk/zsi/test/wsdl2py/test_WSDLImport.py trunk/zsi/test/wsdl2py/test_WSDLImport.wsdl trunk/zsi/test/wsdl2py/test_WSDLImport2.wsdl Modified: trunk/zsi/CHANGES =================================================================== --- trunk/zsi/CHANGES 2007-02-21 00:50:31 UTC (rev 1360) +++ trunk/zsi/CHANGES 2007-02-21 21:14:10 UTC (rev 1361) @@ -6,6 +6,8 @@ - Record facets (restrictions) in XMLSchema.py <vc...@da...> - Remove Send()'s kwargs out of _args list <ef...@bo...> +Change for 2.1.0 released xxx: + Change for 2.0.0 released xxx: - no more wsdl2dispatch, wsdl2py does it all - simplified and consolidated various wsdl2py script options Modified: trunk/zsi/ZSI/generate/commands.py =================================================================== --- trunk/zsi/ZSI/generate/commands.py 2007-02-21 00:50:31 UTC (rev 1360) +++ trunk/zsi/ZSI/generate/commands.py 2007-02-21 21:14:10 UTC (rev 1361) @@ -4,8 +4,8 @@ # See Copyright for copyright notice! ############################################################################ -import exceptions, sys, optparse, os, warnings -from operator import xor +import exceptions, sys, optparse, os, warnings, traceback +#from operator import xor import ZSI from ConfigParser import ConfigParser from ZSI.generate.wsdl2python import WriteServiceModule, ServiceDescription as wsdl2pyServiceDescription @@ -171,7 +171,8 @@ try: wsdl = load(location) except Exception, e: - print "Error loading %s: \n\t%s" % (location, e) + print >> sys.stderr, "Error loading %s: \n\t%s" % (location, e) + traceback.print_exc(sys.stderr) # exit code UNIX specific, Windows? if hasattr(os, 'EX_NOINPUT'): sys.exit(os.EX_NOINPUT) sys.exit("error loading %s" %location) Modified: trunk/zsi/test/wsdl2py/config.txt =================================================================== --- trunk/zsi/test/wsdl2py/config.txt 2007-02-21 00:50:31 UTC (rev 1360) +++ trunk/zsi/test/wsdl2py/config.txt 2007-02-21 21:14:10 UTC (rev 1361) @@ -158,6 +158,7 @@ test_Attributes = test_Attributes.xsd test_DerivedTypes = test_DerivedTypes.xsd test_SubstitutionGroup = test_SubstitutionGroup.xsd +test_WSDLImport = test_WSDLImport.wsdl test_SquareService = SquareService.wsdl test_DateService = DateService.wsdl Added: trunk/zsi/test/wsdl2py/test_WSDLImport.py =================================================================== --- trunk/zsi/test/wsdl2py/test_WSDLImport.py (rev 0) +++ trunk/zsi/test/wsdl2py/test_WSDLImport.py 2007-02-21 21:14:10 UTC (rev 1361) @@ -0,0 +1,63 @@ +#!/usr/bin/env python +############################################################################ +# Joshua R. Boverhof, LBNL +# See LBNLCopyright for copyright notice! +########################################################################### +import os, sys, unittest, time +from ServiceTest import main, ServiceTestCase, ServiceTestSuite +from ZSI import FaultException +from ZSI.TC import _get_global_element_declaration as GED +from ZSI.writer import SoapWriter +from ZSI.parse import ParsedSoap + +""" +Unittest for Bug Report +[ ] + +test_WSDLImport.wsdl +test_WSDLImport2.wsdl + +""" + +# General targets +def dispatch(): + """Run all dispatch tests""" + suite = ServiceTestSuite() + suite.addTest(unittest.makeSuite(WSDLImportTestCase, 'test_dispatch')) + return suite + +def local(): + """Run all local tests""" + suite = ServiceTestSuite() + suite.addTest(unittest.makeSuite(WSDLImportTestCase, 'test_local')) + return suite + +def net(): + """Run all network tests""" + suite = ServiceTestSuite() + suite.addTest(unittest.makeSuite(WSDLImportTestCase, 'test_net')) + return suite + +def all(): + """Run all tests""" + suite = ServiceTestSuite() + suite.addTest(unittest.makeSuite(WSDLImportTestCase, 'test_')) + return suite + + +class WSDLImportTestCase(ServiceTestCase): + name = "test_WSDLImport" + types_file_name = "OutSchemaTest_client.py" + + def __init__(self, methodName): + ServiceTestCase.__init__(self, methodName) + self.wsdl2py_args.append('-b') + + def test_local_attribute1(self): + """ + """ + return + +if __name__ == "__main__" : + main() + Added: trunk/zsi/test/wsdl2py/test_WSDLImport.wsdl =================================================================== --- trunk/zsi/test/wsdl2py/test_WSDLImport.wsdl (rev 0) +++ trunk/zsi/test/wsdl2py/test_WSDLImport.wsdl 2007-02-21 21:14:10 UTC (rev 1361) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding='UTF-8'?> +<definitions name="OutSchemaTest" + targetNamespace="urn:test:import:wsdl" + xmlns:tns="urn:test:import:wsdl" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + + <import namespace="urn:test:import:inner" + location="test_WSDLImport2.wsdl"/> +</definitions> Added: trunk/zsi/test/wsdl2py/test_WSDLImport2.wsdl =================================================================== --- trunk/zsi/test/wsdl2py/test_WSDLImport2.wsdl (rev 0) +++ trunk/zsi/test/wsdl2py/test_WSDLImport2.wsdl 2007-02-21 21:14:10 UTC (rev 1361) @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding='UTF-8'?> +<definitions name="SchemaTest" + targetNamespace="urn:test:import:inner" + xmlns:tns="urn:test:import:inner" + xmlns:types="urn:test:import:types" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <xsd:schema + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:tns="urn:test:import:types" + targetNamespace="urn:test:import:types"> + + <xsd:complexType name='innerType'> + <xsd:sequence> + <xsd:element name="comment" type='xsd:string'/> + <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/> + </xsd:sequence> + </xsd:complexType> + + </xsd:schema> + </types> + + <message name="test"> + <part name='in' type='types:innerType'/> + </message> + <message name="testResponse"/> + + <portType name="SchemaTestPort"> + <operation name="test"> + <input message="tns:test"/> + <output message="tns:testResponse"/> + </operation> + </portType> + <binding name="SchemaTestBinding" type="tns:SchemaTestPort"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="test"> + <soap:operation soapAction="test"/> + <input> <soap:body use="literal" namespace="urn:test:import:inner"/> </input> + <output> <soap:body use="literal" namespace="urn:test:import:inner"/> </output> + </operation> + </binding> + <service name="SchemaTestService"> + <port name="SchemaTestPort" binding="tns:SchemaTestBinding"> + <soap:address location="http://localhost:8881"/> + </port> + </service> +</definitions> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |