From 6b29e5ebd74eb46facd5af8770860d7d5d6118ae Mon Sep 17 00:00:00 2001 From: dkocher Date: Wed, 21 Oct 2015 12:23:59 +0000 Subject: [PATCH] Add test. git-svn-id: https://svn.cyberduck.io/trunk@18391 9e2dff1d-8f06-0410-b5b1-4d70b6340adc --- test/ch/cyberduck/core/irods/IRODSSessionTest.java | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/test/ch/cyberduck/core/irods/IRODSSessionTest.java b/test/ch/cyberduck/core/irods/IRODSSessionTest.java index ca0e5b645b..c77606e34c 100644 --- a/test/ch/cyberduck/core/irods/IRODSSessionTest.java +++ b/test/ch/cyberduck/core/irods/IRODSSessionTest.java @@ -31,6 +31,7 @@ import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.Profile; import ch.cyberduck.core.ProfileReaderFactory; +import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.LoginFailureException; import org.junit.Test; @@ -61,7 +62,7 @@ public class IRODSSessionTest extends AbstractTestCase { } @Test - public void testLogin() throws Exception { + public void testLoginDefault() throws Exception { final Profile profile = ProfileReaderFactory.get().read( new Local("profiles/iRODS (iPlant Collaborative).cyberduckprofile")); final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials( @@ -85,6 +86,31 @@ public class IRODSSessionTest extends AbstractTestCase { assertFalse(session.isConnected()); } + @Test(expected = BackgroundException.class) + public void testLoginPam() throws Exception { + final Profile profile = ProfileReaderFactory.get().read( + new Local("profiles/iRODS (iPlant Collaborative).cyberduckprofile")); + final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials( + String.format("PAM:%s", properties.getProperty("irods.key")), properties.getProperty("irods.secret") + )); + + final IRODSSession session = new IRODSSession(host); + + assertNotNull(session.open(new DisabledHostKeyCallback(), new DisabledTranscriptListener())); + assertTrue(session.isConnected()); + assertNotNull(session.getClient()); + + session.login(new DisabledPasswordStore(), new DisabledLoginCallback(), new DisabledCancelCallback()); + assertNotNull(session.workdir()); + + final AttributedList list = session.list(session.workdir(), new DisabledListProgressListener()); + assertFalse(list.isEmpty()); + + assertTrue(session.isConnected()); + session.close(); + assertFalse(session.isConnected()); + } + @Test(expected = LoginFailureException.class) public void testLoginFailure() throws Exception { final Profile profile = ProfileReaderFactory.get().read( -- 2.11.4.GIT