org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal

Here are the examples of the java api class org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal taken from open source projects.

1. UserPrincipalTest#testEquals()

View license
@Test
public void testEquals() {
    UserPrincipal p1 = new UserPrincipal("FOO");
    UserPrincipal p2 = new UserPrincipal("FOO");
    UserPrincipal p3 = new UserPrincipal("BAR");
    assertTrue(p1.equals(p1));
    assertTrue(p1.equals(p2));
    assertFalse(p1.equals(null));
    assertFalse(p1.equals("FOO"));
    assertFalse(p1.equals(p3));
}

2. UserPrincipalTest#testArguments()

View license
@Test
public void testArguments() {
    UserPrincipal principal = new UserPrincipal("FOO");
    assertEquals("FOO", principal.getName());
    try {
        new UserPrincipal(null);
        fail("Should have thrown IllegalArgumentException");
    } catch (IllegalArgumentException ingore) {
    }
}

3. UserPrincipalTest#testHash()

View license
@Test
public void testHash() {
    UserPrincipal p1 = new UserPrincipal("FOO");
    UserPrincipal p2 = new UserPrincipal("FOO");
    assertEquals(p1.hashCode(), p1.hashCode());
    assertEquals(p1.hashCode(), p2.hashCode());
}