NO-JIRA: fix checkstyle broken after c38c5a91aa

This commit is contained in:
Clebert Suconic 2016-12-13 15:53:22 -05:00
parent 33af9901c6
commit d5be1c6dc6
1 changed files with 6 additions and 10 deletions

View File

@ -483,7 +483,6 @@ public class SimpleJNDIClientTest extends ActiveMQTestBase {
@Test @Test
public void testRemoteCFWithTCPUserPassword() throws Exception { public void testRemoteCFWithTCPUserPassword() throws Exception {
//setup user and role on broker //setup user and role on broker
((ActiveMQJAASSecurityManager) liveService.getSecurityManager()).getConfiguration().addUser("myUser", "myPassword"); ((ActiveMQJAASSecurityManager) liveService.getSecurityManager()).getConfiguration().addUser("myUser", "myPassword");
((ActiveMQJAASSecurityManager) liveService.getSecurityManager()).getConfiguration().addRole("myUser", "consumeCreateRole"); ((ActiveMQJAASSecurityManager) liveService.getSecurityManager()).getConfiguration().addRole("myUser", "consumeCreateRole");
@ -499,12 +498,10 @@ public class SimpleJNDIClientTest extends ActiveMQTestBase {
props.put("connectionFactory.myConnectionFactory", "tcp://127.0.0.1:61616?user=myUser&password=myPassword"); props.put("connectionFactory.myConnectionFactory", "tcp://127.0.0.1:61616?user=myUser&password=myPassword");
Context ctx = new InitialContext(props); Context ctx = new InitialContext(props);
//create a connection factory //create a connection factory
ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory"); ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
Assert.assertEquals("ensure user is set","myUser", connectionFactory.getUser()); Assert.assertEquals("ensure user is set", "myUser", connectionFactory.getUser());
Assert.assertEquals("ensure password is set", "myPassword",connectionFactory.getPassword()); Assert.assertEquals("ensure password is set", "myPassword", connectionFactory.getPassword());
//Connect to broker to verify credentials are used with connection //Connect to broker to verify credentials are used with connection
Connection connection = connectionFactory.createConnection(); Connection connection = connectionFactory.createConnection();
@ -519,15 +516,14 @@ public class SimpleJNDIClientTest extends ActiveMQTestBase {
MessageProducer producer = session.createProducer(queue); MessageProducer producer = session.createProducer(queue);
producer.send(session.createTextMessage("test Msg")); producer.send(session.createTextMessage("test Msg"));
Assert.fail("Sending message should throw a JMSSecurityException"); Assert.fail("Sending message should throw a JMSSecurityException");
}catch (JMSSecurityException e) { } catch (JMSSecurityException e) {
//expected //expected
} }
MessageConsumer consumer = session.createConsumer(queue); MessageConsumer consumer = session.createConsumer(queue);
} finally { } finally {
connection.close(); connection.close();
} }
} }
} }