java/sql-java-prihlasovani/test/cz/frantovo/jaas/sql/SQLLoginModulTest.java
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--
uživatelé a skupiny v SQL databázi, parametrizace, hellDesk: #11
     1 package cz.frantovo.jaas.sql;
     2 
     3 import javax.security.auth.login.LoginException;
     4 import org.junit.Test;
     5 import static org.junit.Assert.*;
     6 
     7 /**
     8  *
     9  * @author fiki
    10  */
    11 public class SQLLoginModulTest {
    12 
    13 	@Test(expected = LoginException.class)
    14 	public void testŠpatnýRealm() throws LoginException {
    15 		try {
    16 			SQLLoginModul m = new SQLLoginModul();
    17 			m.authenticateUser();
    18 		} catch (LoginException e) {
    19 			System.out.println("testŠpatnýRealm: " + e.getMessage());
    20 			assertTrue(e.getMessage().startsWith("Špatný realm"));
    21 			throw e;
    22 		}
    23 	}
    24 }