From e8de39bae08b511e9b62e71a7d52cce2df10d54f Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Sat, 15 Jan 2005 13:11:25 +0000 Subject: Updated authors. Changed authors & copyright in SWIG and unit tests headers. Extracted binding_tests.py from profiles_tests.py, so that each language has a binding specific test. --- AUTHORS | 48 +++---- java/tests/LoginTest.java | 16 ++- perl/tests/binding_tests.pl | 25 +++- php/patch_swig_output.py | 29 ++++- php/tests/binding_tests.php | 27 +++- php/tests/perfs.php | 27 +++- python/tests/XmlTestRunner.py | 2 + python/tests/binding_tests.py | 249 ++++++++++++++++++++++++++++++++++++ python/tests/errorchecking_tests.py | 11 +- python/tests/profiles_tests.py | 220 ++----------------------------- python/tests/tests.py | 12 +- swig/Lasso-wsf.i | 6 +- swig/Lasso.i | 6 +- 13 files changed, 407 insertions(+), 271 deletions(-) create mode 100755 python/tests/binding_tests.py diff --git a/AUTHORS b/AUTHORS index c388d30e..3f7a6da1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,51 +9,41 @@ Authors (see README_ for details) -Main Developers -=============== - -- Nicolas Clapiès (initial developer) -- Valéry Febvre (lead developer) - - -Packaging -========= +Core +==== - Nicolas Clapiès - Valéry Febvre - Frédéric Péters -C Unit Tests -============ - -- Frédéric Péters - - -Java Bindings +SWIG Bindings ============= -- Benjamin Poussin (initial developer) - Emmanuel Raviart +with help from: -Java Unit Tests -=============== +- Romain Chantereau (initial SWIG binding) +- Christophe Nowicki (PHP) +- Benjamin Poussin (first Java binding) +- and the core developers -- Emmanuel Raviart +Unit Tests +========== -Python Bindings -=============== +- Emmanuel Raviart -- Nicolas Clapiès -- Valéry Febvre +with help from: +- Frédéric Péters -Python Unit Tests -================= -- Emmanuel Raviart +Packaging +========= + +- Frédéric Péters Debian Packaging @@ -89,4 +79,8 @@ Lasso Logo Web Site Design =============== +- Frédéric Péters + +with help from: + - Cédric Musso (initial design) diff --git a/java/tests/LoginTest.java b/java/tests/LoginTest.java index 29ca5bb9..9ff66239 100644 --- a/java/tests/LoginTest.java +++ b/java/tests/LoginTest.java @@ -1,22 +1,23 @@ /* - * JLasso -- Java bindings for Lasso library + * $Id$ * - * Copyright (C) 2004 Entr'ouvert + * Java unit tests for Lasso library + * + * Copyright (C) 2004, 2005 Entr'ouvert * http://lasso.entrouvert.org * - * Authors: Benjamin Poussin - * Emmanuel Raviart + * Authors: See AUTHORS file. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program 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 General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -31,8 +32,9 @@ // $ gcj -C -classpath /usr/share/java/junit.jar:../target/lasso.jar:. LoginTest.java // $ gij -classpath /usr/share/java/junit.jar:../target/lasso.jar:. LoginTest -import junit.framework.TestCase; + import junit.framework.Test; +import junit.framework.TestCase; import junit.framework.TestSuite; import com.entrouvert.lasso.*; diff --git a/perl/tests/binding_tests.pl b/perl/tests/binding_tests.pl index b519abee..c8766ed2 100755 --- a/perl/tests/binding_tests.pl +++ b/perl/tests/binding_tests.pl @@ -1,4 +1,27 @@ -#!/usr/bin/env perl +#! /usr/bin/env perl +# +# $Id$ +# +# Perl unit tests for Lasso library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use lasso; diff --git a/php/patch_swig_output.py b/php/patch_swig_output.py index 8b46bc42..cd43e013 100755 --- a/php/patch_swig_output.py +++ b/php/patch_swig_output.py @@ -1,8 +1,33 @@ #! /usr/bin/env python +# -*- coding: UTF-8 -*- +# +# $Id$ +# +# SWIG based PHP binding for Lasso Library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -"""Correct Swig output for PHP binding. -The PHP binding of Swig version 1.3.22 has several bugs: +"""Correct SWIG output for PHP binding. + +The PHP binding of SWIG version 1.3.22 has several bugs: (1) It wraps NULL pointers into non NULL PHP objects. diff --git a/php/tests/binding_tests.php b/php/tests/binding_tests.php index b43aef76..bf8ec5fe 100755 --- a/php/tests/binding_tests.php +++ b/php/tests/binding_tests.php @@ -1,4 +1,29 @@ -#! /usr/bin/php +#! /usr/bin/env php +# +# $Id$ +# +# PHP unit tests for Lasso library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + do 1 +""" + actionString2 = """\ + + do 2 +""" + actionString3 = """\ + + do 3 +""" + extension = lasso.StringList() + self.failUnlessEqual(len(extension), 0) + extension.append(actionString1) + self.failUnlessEqual(len(extension), 1) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[0], actionString1) + extension.append(actionString2) + self.failUnlessEqual(len(extension), 2) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + extension.append(actionString3) + self.failUnlessEqual(len(extension), 3) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + self.failUnlessEqual(extension[2], actionString3) + authnRequest.extension = extension + self.failUnlessEqual(authnRequest.extension[0], actionString1) + self.failUnlessEqual(authnRequest.extension[1], actionString2) + self.failUnlessEqual(authnRequest.extension[2], actionString3) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + self.failUnlessEqual(extension[2], actionString3) + del extension + self.failUnlessEqual(authnRequest.extension[0], actionString1) + self.failUnlessEqual(authnRequest.extension[1], actionString2) + self.failUnlessEqual(authnRequest.extension[2], actionString3) + extension = authnRequest.extension + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + self.failUnlessEqual(extension[2], actionString3) + del extension + self.failUnlessEqual(authnRequest.extension[0], actionString1) + self.failUnlessEqual(authnRequest.extension[1], actionString2) + self.failUnlessEqual(authnRequest.extension[2], actionString3) + authnRequest.extension = None + self.failUnlessEqual(authnRequest.extension, None) + + del authnRequest + + def test06(self): + """Get & set attributes of nodes of type node.""" + + login = lasso.Login(lasso.Server()) + + self.failUnlessEqual(login.request, None) + login.request = lasso.LibAuthnRequest() + login.request.consent = lasso.libConsentObtained + self.failUnlessEqual(login.request.consent, lasso.libConsentObtained) + login.request = None + self.failUnlessEqual(login.request, None) + + del login + + +bindingSuite = unittest.makeSuite(BindingTestCase, 'test') + +allTests = unittest.TestSuite((bindingSuite, )) + +if __name__ == '__main__': + sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful()) + diff --git a/python/tests/errorchecking_tests.py b/python/tests/errorchecking_tests.py index 1ea9e1e7..e04ddfff 100644 --- a/python/tests/errorchecking_tests.py +++ b/python/tests/errorchecking_tests.py @@ -1,14 +1,15 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- - - +# +# $Id$ +# # Python unit tests for Lasso library -# By: Frederic Peters -# Emmanuel Raviart # -# Copyright (C) 2004 Entr'ouvert +# Copyright (C) 2004, 2005 Entr'ouvert # http://lasso.entrouvert.org # +# Authors: See AUTHORS file. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/python/tests/profiles_tests.py b/python/tests/profiles_tests.py index bc9a4d26..cd7293ba 100755 --- a/python/tests/profiles_tests.py +++ b/python/tests/profiles_tests.py @@ -1,14 +1,15 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- - - +# +# $Id$ +# # Python unit tests for Lasso library -# By: Frederic Peters -# Emmanuel Raviart # -# Copyright (C) 2004 Entr'ouvert +# Copyright (C) 2004, 2005 Entr'ouvert # http://lasso.entrouvert.org # +# Authors: See AUTHORS file. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -42,210 +43,6 @@ except NameError: dataDir = '../../tests/data' -class BindingTestCase(unittest.TestCase): - def test01(self): - """Create and delete nodes.""" - - authnRequest = lasso.LibAuthnRequest() - del authnRequest - - def test02(self): - """Get & set simple attributes of nodes.""" - - authnRequest = lasso.LibAuthnRequest() - - # Test a string attribute. - self.failUnlessEqual(authnRequest.consent, None) - authnRequest.consent = lasso.libConsentObtained - self.failUnlessEqual(authnRequest.consent, lasso.libConsentObtained) - authnRequest.consent = None - self.failUnlessEqual(authnRequest.consent, None) - - # Test a renamed string attribute. - self.failUnlessEqual(authnRequest.relayState, None) - authnRequest.relayState = 'Hello World!' - self.failUnlessEqual(authnRequest.relayState, 'Hello World!') - authnRequest.relayState = None - self.failUnlessEqual(authnRequest.relayState, None) - - # Test an integer attribute. - self.failUnlessEqual(authnRequest.majorVersion, 0) - authnRequest.majorVersion = 314 - self.failUnlessEqual(authnRequest.majorVersion, 314) - - del authnRequest - - def test03(self): - """Get & set attributes of nodes of type string list.""" - - authnRequest = lasso.LibAuthnRequest() - - self.failUnlessEqual(authnRequest.respondWith, None) - - respondWith = lasso.StringList() - self.failUnlessEqual(len(respondWith), 0) - respondWith.append('first string') - self.failUnlessEqual(len(respondWith), 1) - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[0], 'first string') - respondWith.append('second string') - self.failUnlessEqual(len(respondWith), 2) - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - respondWith.append('third string') - self.failUnlessEqual(len(respondWith), 3) - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - self.failUnlessEqual(respondWith[2], 'third string') - authnRequest.respondWith = respondWith - self.failUnlessEqual(authnRequest.respondWith[0], 'first string') - self.failUnlessEqual(authnRequest.respondWith[1], 'second string') - self.failUnlessEqual(authnRequest.respondWith[2], 'third string') - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - self.failUnlessEqual(respondWith[2], 'third string') - del respondWith - self.failUnlessEqual(authnRequest.respondWith[0], 'first string') - self.failUnlessEqual(authnRequest.respondWith[1], 'second string') - self.failUnlessEqual(authnRequest.respondWith[2], 'third string') - respondWith = authnRequest.respondWith - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - self.failUnlessEqual(respondWith[2], 'third string') - del respondWith - self.failUnlessEqual(authnRequest.respondWith[0], 'first string') - self.failUnlessEqual(authnRequest.respondWith[1], 'second string') - self.failUnlessEqual(authnRequest.respondWith[2], 'third string') - authnRequest.respondWith = None - self.failUnlessEqual(authnRequest.respondWith, None) - - del authnRequest - - def test04(self): - """Get & set attributes of nodes of type node list.""" - - response = lasso.SamlpResponse() - - self.failUnlessEqual(response.assertion, None) - - assertions = lasso.NodeList() - self.failUnlessEqual(len(assertions), 0) - assertion1 = lasso.SamlAssertion() - assertion1.assertionId = 'assertion 1' - assertions.append(assertion1) - self.failUnlessEqual(len(assertions), 1) - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - assertion2 = lasso.SamlAssertion() - assertion2.assertionId = 'assertion 2' - assertions.append(assertion2) - self.failUnlessEqual(len(assertions), 2) - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - assertion3 = lasso.SamlAssertion() - assertion3.assertionId = 'assertion 3' - assertions.append(assertion3) - self.failUnlessEqual(len(assertions), 3) - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') - response.assertion = assertions - self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') - self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') - self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') - del assertions - self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') - self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') - self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') - assertions = response.assertion - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') - del assertions - self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') - self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') - self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') - response.assertion = None - self.failUnlessEqual(response.assertion, None) - - del response - - def test05(self): - """Get & set attributes of nodes of type XML list.""" - - authnRequest = lasso.LibAuthnRequest() - - self.failUnlessEqual(authnRequest.extension, None) - - actionString1 = """\ - - do 1 -""" - actionString2 = """\ - - do 2 -""" - actionString3 = """\ - - do 3 -""" - extension = lasso.StringList() - self.failUnlessEqual(len(extension), 0) - extension.append(actionString1) - self.failUnlessEqual(len(extension), 1) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[0], actionString1) - extension.append(actionString2) - self.failUnlessEqual(len(extension), 2) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - extension.append(actionString3) - self.failUnlessEqual(len(extension), 3) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - self.failUnlessEqual(extension[2], actionString3) - authnRequest.extension = extension - self.failUnlessEqual(authnRequest.extension[0], actionString1) - self.failUnlessEqual(authnRequest.extension[1], actionString2) - self.failUnlessEqual(authnRequest.extension[2], actionString3) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - self.failUnlessEqual(extension[2], actionString3) - del extension - self.failUnlessEqual(authnRequest.extension[0], actionString1) - self.failUnlessEqual(authnRequest.extension[1], actionString2) - self.failUnlessEqual(authnRequest.extension[2], actionString3) - extension = authnRequest.extension - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - self.failUnlessEqual(extension[2], actionString3) - del extension - self.failUnlessEqual(authnRequest.extension[0], actionString1) - self.failUnlessEqual(authnRequest.extension[1], actionString2) - self.failUnlessEqual(authnRequest.extension[2], actionString3) - authnRequest.extension = None - self.failUnlessEqual(authnRequest.extension, None) - - del authnRequest - - def test06(self): - """Get & set attributes of nodes of type node.""" - - login = lasso.Login(lasso.Server()) - - self.failUnlessEqual(login.request, None) - login.request = lasso.LibAuthnRequest() - login.request.consent = lasso.libConsentObtained - self.failUnlessEqual(login.request.consent, lasso.libConsentObtained) - login.request = None - self.failUnlessEqual(login.request, None) - - del login - - class ServerTestCase(unittest.TestCase): def test01(self): """Server construction, dump & newFromDump.""" @@ -454,15 +251,14 @@ class IdentityTestCase(unittest.TestCase): self.failUnlessEqual(identityDump, newIdentityDump) -bindingSuite = unittest.makeSuite(BindingTestCase, 'test') serverSuite = unittest.makeSuite(ServerTestCase, 'test') loginSuite = unittest.makeSuite(LoginTestCase, 'test') logoutSuite = unittest.makeSuite(LogoutTestCase, 'test') defederationSuite = unittest.makeSuite(DefederationTestCase, 'test') identitySuite = unittest.makeSuite(IdentityTestCase, 'test') -allTests = unittest.TestSuite((bindingSuite, serverSuite, loginSuite, logoutSuite, - defederationSuite, identitySuite)) +allTests = unittest.TestSuite((serverSuite, loginSuite, logoutSuite, defederationSuite, + identitySuite)) if __name__ == '__main__': sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful()) diff --git a/python/tests/tests.py b/python/tests/tests.py index de3cf808..35c15691 100755 --- a/python/tests/tests.py +++ b/python/tests/tests.py @@ -1,14 +1,15 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- - - +# +# $Id$ +# # Python unit tests for Lasso library -# By: Frederic Peters -# Emmanuel Raviart # -# Copyright (C) 2004 Entr'ouvert +# Copyright (C) 2004, 2005 Entr'ouvert # http://lasso.entrouvert.org # +# Authors: See AUTHORS file. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -41,6 +42,7 @@ if not '../.libs' in sys.path: testSuites = ( + 'binding_tests', 'profiles_tests', 'errorchecking_tests', ) diff --git a/swig/Lasso-wsf.i b/swig/Lasso-wsf.i index 72096696..dc3cdaf5 100644 --- a/swig/Lasso-wsf.i +++ b/swig/Lasso-wsf.i @@ -7,11 +7,7 @@ * Copyright (C) 2004, 2005 Entr'ouvert * http://lasso.entrouvert.org * - * Authors: Romain Chantereau - * Nicolas Clapies - * Valery Febvre - * Frederic Peters - * Emmanuel Raviart + * Authors: See AUTHORS file. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/swig/Lasso.i b/swig/Lasso.i index 4f1d23db..264ade29 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -7,11 +7,7 @@ * Copyright (C) 2004, 2005 Entr'ouvert * http://lasso.entrouvert.org * - * Authors: Romain Chantereau - * Nicolas Clapies - * Valery Febvre - * Frederic Peters - * Emmanuel Raviart + * Authors: See AUTHORS file. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- cgit