diff -r aff44e80f418 -r 46bb283a674d java/sql-java-prihlasovani/test/cz/frantovo/jaas/sql/SQLLoginModulTest.java --- a/java/sql-java-prihlasovani/test/cz/frantovo/jaas/sql/SQLLoginModulTest.java Tue Feb 07 00:27:39 2012 +0100 +++ b/java/sql-java-prihlasovani/test/cz/frantovo/jaas/sql/SQLLoginModulTest.java Tue Feb 07 18:03:31 2012 +0100 @@ -1,5 +1,6 @@ package cz.frantovo.jaas.sql; +import javax.security.auth.login.LoginException; import org.junit.Test; import static org.junit.Assert.*; @@ -9,4 +10,15 @@ */ public class SQLLoginModulTest { + @Test(expected = LoginException.class) + public void testŠpatnýRealm() throws LoginException { + try { + SQLLoginModul m = new SQLLoginModul(); + m.authenticateUser(); + } catch (LoginException e) { + System.out.println("testŠpatnýRealm: " + e.getMessage()); + assertTrue(e.getMessage().startsWith("Špatný realm")); + throw e; + } + } }