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

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

1. RolePrincipalTest#testEquals()

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

2. RolePrincipalTest#testArguments()

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

3. RolePrincipalTest#testHash()

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