/** * Tests connection functionality. * * @throws Exception unexpected */ @Test public void test01CanConnect() throws Exception { session.connect(HOST, PORT); assertTrue(session.isConnected()); }
/** Test handling of bad port. */ @Test(expected = IOException.class) public void test02ConnectWithBadPortThrowsException() throws Exception { session.connect(HOST, 12345); }
/** Test attempt to login with bad credentials. */ @Test public void test04LoginWithBadCredentialsFails() throws Exception { session.connect(HOST, PORT); assertTrue(!session.login("failtestuser", PASSWORD)); assertTrue(!session.login(USER, "badpass")); }
/** Test handling of bad host. */ @Test(expected = IOException.class) public void test01ConnectWithBadHostThrowsException() throws Exception { session.connect("banana", PORT); }