summaryrefslogtreecommitdiffstats
path: root/java/tests/BindingTests.java
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2005-01-15 15:12:00 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2005-01-15 15:12:00 +0000
commitae9e7d05bc8f8701150ed5dfe223e0fded6767a3 (patch)
tree28a1d11bcbcdd07d8d06ea9070c74a6af3da51d3 /java/tests/BindingTests.java
parent8d53ec860626142e1b8d91de871c05b1e05d982e (diff)
downloadlasso-ae9e7d05bc8f8701150ed5dfe223e0fded6767a3.tar.gz
lasso-ae9e7d05bc8f8701150ed5dfe223e0fded6767a3.tar.xz
lasso-ae9e7d05bc8f8701150ed5dfe223e0fded6767a3.zip
SWIG: Renamed getitem to getItem. Idem for setitem.
Java: Added a third binding test. PHP: Corrected header of binding test.
Diffstat (limited to 'java/tests/BindingTests.java')
-rw-r--r--java/tests/BindingTests.java60
1 files changed, 53 insertions, 7 deletions
diff --git a/java/tests/BindingTests.java b/java/tests/BindingTests.java
index a09f4e20..ddde3ba3 100644
--- a/java/tests/BindingTests.java
+++ b/java/tests/BindingTests.java
@@ -41,8 +41,17 @@ import com.entrouvert.lasso.*;
public class BindingTests extends TestCase {
+ public static void main(String args[]) {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(BindingTests.class);
+ }
+
public void test01() {
// Create and delete nodes.
+
LibAuthnRequest authnRequest = new LibAuthnRequest();
authnRequest = null;
}
@@ -74,13 +83,50 @@ public class BindingTests extends TestCase {
authnRequest = null;
}
- public static Test suite() {
- return new TestSuite(BindingTests.class);
- }
+ public void test03() {
+ // Get & set attributes of nodes of type string list.
- public static void main(String args[]) {
- lasso.init();
- junit.textui.TestRunner.run(suite());
- lasso.shutdown();
+ LibAuthnRequest authnRequest = new LibAuthnRequest();
+
+ assertNull(authnRequest.getRespondWith());
+
+ StringList respondWith = new StringList();
+ assertEquals(respondWith.length(), 0);
+ respondWith.append("first string");
+ assertEquals(respondWith.length(), 1);
+ assertEquals(respondWith.getItem(0), "first string");
+ assertEquals(respondWith.getItem(0), "first string");
+ respondWith.append("second string");
+ assertEquals(respondWith.length(), 2);
+ assertEquals(respondWith.getItem(0), "first string");
+ assertEquals(respondWith.getItem(1), "second string");
+ respondWith.append("third string");
+ assertEquals(respondWith.length(), 3);
+ assertEquals(respondWith.getItem(0), "first string");
+ assertEquals(respondWith.getItem(1), "second string");
+ assertEquals(respondWith.getItem(2), "third string");
+ authnRequest.setRespondWith(respondWith);
+ assertEquals(authnRequest.getRespondWith().getItem(0), "first string");
+ assertEquals(authnRequest.getRespondWith().getItem(1), "second string");
+ assertEquals(authnRequest.getRespondWith().getItem(2), "third string");
+ assertEquals(respondWith.getItem(0), "first string");
+ assertEquals(respondWith.getItem(1), "second string");
+ assertEquals(respondWith.getItem(2), "third string");
+ respondWith = null;
+ assertEquals(authnRequest.getRespondWith().getItem(0), "first string");
+ assertEquals(authnRequest.getRespondWith().getItem(1), "second string");
+ assertEquals(authnRequest.getRespondWith().getItem(2), "third string");
+ respondWith = authnRequest.getRespondWith();
+ assertEquals(respondWith.getItem(0), "first string");
+ assertEquals(respondWith.getItem(1), "second string");
+ assertEquals(respondWith.getItem(2), "third string");
+ respondWith = null;
+ assertEquals(authnRequest.getRespondWith().getItem(0), "first string");
+ assertEquals(authnRequest.getRespondWith().getItem(1), "second string");
+ assertEquals(authnRequest.getRespondWith().getItem(2), "third string");
+ authnRequest.setRespondWith(null);
+ assertNull(authnRequest.getRespondWith());
+
+ authnRequest = null;
}
}