1.1 --- a/java/sql-java-prihlasovani/test/cz/frantovo/jaas/sql/SQLLoginModulTest.java Tue Feb 07 00:27:39 2012 +0100
1.2 +++ b/java/sql-java-prihlasovani/test/cz/frantovo/jaas/sql/SQLLoginModulTest.java Tue Feb 07 18:03:31 2012 +0100
1.3 @@ -1,5 +1,6 @@
1.4 package cz.frantovo.jaas.sql;
1.5
1.6 +import javax.security.auth.login.LoginException;
1.7 import org.junit.Test;
1.8 import static org.junit.Assert.*;
1.9
1.10 @@ -9,4 +10,15 @@
1.11 */
1.12 public class SQLLoginModulTest {
1.13
1.14 + @Test(expected = LoginException.class)
1.15 + public void testŠpatnýRealm() throws LoginException {
1.16 + try {
1.17 + SQLLoginModul m = new SQLLoginModul();
1.18 + m.authenticateUser();
1.19 + } catch (LoginException e) {
1.20 + System.out.println("testŠpatnýRealm: " + e.getMessage());
1.21 + assertTrue(e.getMessage().startsWith("Špatný realm"));
1.22 + throw e;
1.23 + }
1.24 + }
1.25 }