diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-07-22 18:38:50 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-07-22 18:38:50 +0000 |
| commit | 9fafbcd580f9588a0b10bb430eed7b2acd99233d (patch) | |
| tree | c284e67a01994dffdfaa4a4966b987ae21f0f1f0 /java/tests/LoginTest.java | |
| parent | 55aeba092c8d40053e1dbff6af75176dfee2586d (diff) | |
| download | lasso-9fafbcd580f9588a0b10bb430eed7b2acd99233d.tar.gz lasso-9fafbcd580f9588a0b10bb430eed7b2acd99233d.tar.xz lasso-9fafbcd580f9588a0b10bb430eed7b2acd99233d.zip | |
Nearly completed Python & Java first non-regression test for login.
But Java test doesn't work:
java.lang.UnsatisfiedLinkError: libjlasso: not found
Adding its directory to LD_LIBRARY_PATH may help.
at LoginTest.main (LoginTest.java:165)
And I don't understand why.
Please professor, help me!
Diffstat (limited to 'java/tests/LoginTest.java')
| -rw-r--r-- | java/tests/LoginTest.java | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/java/tests/LoginTest.java b/java/tests/LoginTest.java index 3b97bd52..0aa18cfe 100644 --- a/java/tests/LoginTest.java +++ b/java/tests/LoginTest.java @@ -78,13 +78,14 @@ public class LoginTest extends TestCase { public void test02_serviceProviderLogin() { boolean userAuthenticated; - int method; + int method, requestType; LassoAuthnRequest authnRequest; LassoLogin idpLoginContext, spLoginContext; + LassoResponse response; LassoServer idpContext, spContext; String artifact, authenticationMethod, authnRequestQuery, authnRequestUrl, idpContextDump, - nameIdentifier, relayState, responseMsg, responseQuery, responseUrl, spContextDump, - soapEndpoint, soapRequestMsg; + idpUserContextDump, nameIdentifier, relayState, responseQuery, responseUrl, + soapEndpoint, soapResponseMsg, soapRequestMsg, spContextDump, spUserContextDump; // Service provider login using HTTP redirect. spContextDump = generateServiceProviderContextDump(); @@ -118,9 +119,11 @@ public class LoginTest extends TestCase { assertEquals(idpLoginContext.buildArtifactMsg( userAuthenticated, authenticationMethod, "FIXME: reauthenticateOnOrAfter", Lasso.httpMethodRedirect), 0); + idpUserContextDump = spLoginContext.getUser().dump(); + assertNotNull(idpUserContextDump); responseUrl = idpLoginContext.getMsgUrl(); responseQuery = responseUrl.substring(responseUrl.indexOf("?") + 1); - responseMsg = idpLoginContext.getResponseDump(); + soapResponseMsg = idpLoginContext.getResponseDump(); artifact = idpLoginContext.getAssertionArtifact(); nameIdentifier = idpLoginContext.getNameIdentifier(); method = Lasso.httpMethodRedirect; @@ -134,6 +137,24 @@ public class LoginTest extends TestCase { assertEquals(spLoginContext.buildRequestMsg(), 0); soapEndpoint = spLoginContext.getMsgUrl(); soapRequestMsg = spLoginContext.getMsgBody(); + + // Identity provider SOAP endpoint. + idpContextDump = generateIdentityProviderContextDump(); + assertNotNull(idpContextDump); + requestType = Lasso.getRequestTypeFromSoapMsg(soapRequestMsg); + assertEquals(requestType, Lasso.requestTypeLogin); + + // Service provider assertion consumer (step 2). + assertEquals(spLoginContext.processResponseMsg(soapResponseMsg), 0); + assertEquals(spLoginContext.getNameIdentifier(), nameIdentifier); + // The user doesn't have any federation yet. + assertEquals(spLoginContext.createUser(null), 0); + spUserContextDump = spLoginContext.getUser().dump(); + assertNotNull(spUserContextDump); + response = (LassoResponse) spLoginContext.getResponse(); +// authenticationMethod = response.get_child( +// "AuthenticationStatement").get_attr_value("AuthenticationMethod") +// self.failUnlessEqual(authenticationMethod, lasso.samlAuthenticationMethodPassword) } public static Test suite() { |
