author | František Kučera <franta-hg@frantovo.cz> |
Tue, 07 Feb 2012 18:03:31 +0100 | |
changeset 7 | 46bb283a674d |
parent 5 | e013564c8e6f |
permissions | -rw-r--r-- |
franta-hg@5 | 1 |
package cz.frantovo.jaas.sql; |
franta-hg@5 | 2 |
|
franta-hg@7 | 3 |
import javax.security.auth.login.LoginException; |
franta-hg@5 | 4 |
import org.junit.Test; |
franta-hg@5 | 5 |
import static org.junit.Assert.*; |
franta-hg@5 | 6 |
|
franta-hg@5 | 7 |
/** |
franta-hg@5 | 8 |
* |
franta-hg@5 | 9 |
* @author fiki |
franta-hg@5 | 10 |
*/ |
franta-hg@5 | 11 |
public class SQLLoginModulTest { |
franta-hg@5 | 12 |
|
franta-hg@7 | 13 |
@Test(expected = LoginException.class) |
franta-hg@7 | 14 |
public void testŠpatnýRealm() throws LoginException { |
franta-hg@7 | 15 |
try { |
franta-hg@7 | 16 |
SQLLoginModul m = new SQLLoginModul(); |
franta-hg@7 | 17 |
m.authenticateUser(); |
franta-hg@7 | 18 |
} catch (LoginException e) { |
franta-hg@7 | 19 |
System.out.println("testŠpatnýRealm: " + e.getMessage()); |
franta-hg@7 | 20 |
assertTrue(e.getMessage().startsWith("Špatný realm")); |
franta-hg@7 | 21 |
throw e; |
franta-hg@7 | 22 |
} |
franta-hg@7 | 23 |
} |
franta-hg@5 | 24 |
} |