| package brooklyn.entity.webapp.jboss; |
| |
| import org.testng.annotations.Test; |
| |
| import static org.testng.Assert.assertEquals; |
| |
| /** |
| * Expected values in tests were generated by AS7's add-user.sh script and copied here. |
| */ |
| public class JBoss7PasswordHashingTest { |
| |
| @Test |
| public void testPasswordForManagementRealm() { |
| assertEquals( |
| JBoss7SshDriver.hashPassword("username", "password", "ManagementRealm"), |
| "8959126dd54df47f694cd762a51a1a6f"); |
| assertEquals( |
| JBoss7SshDriver.hashPassword("test", "123", "ManagementRealm"), |
| "090d846d31185e54a5e8811a2ccb43ee"); |
| } |
| |
| @Test |
| public void testPasswordForApplicationRealm() { |
| assertEquals( |
| JBoss7SshDriver.hashPassword("username", "password", "ApplicationRealm"), |
| "888a0504c559a34b1c3e919dcec6d941"); |
| assertEquals( |
| JBoss7SshDriver.hashPassword("test", "321", "ApplicationRealm"), |
| "a0fdaa45e2d509ac2d390ff6820e2a10"); |
| } |
| |
| @Test |
| public void testPasswordForCustomRealm() { |
| assertEquals( |
| JBoss7SshDriver.hashPassword("abcdef", "ghijkl", "BrooklynRealm"), |
| "a65be1ba2eb88b9b9edc6a2a7105af72"); |
| assertEquals( |
| JBoss7SshDriver.hashPassword("username", "password", "BrooklynRealm"), |
| "161124b73591a1483330f496311b0692"); |
| } |
| |
| } |