@Test public void addFull() throws Exception { AddSecurityRealm addSecurityRealm = new AddSecurityRealm.Builder(TEST_SECURITY_REALM_NAME).mapGroupsToRoles(true).build(); client.apply(addSecurityRealm); assertTrue("The security realm should be created", ops.exists(TEST_SECURITY_REALM_ADDRESS)); ModelNodeResult readAttribute = ops.readAttribute(TEST_SECURITY_REALM_ADDRESS, "map-groups-to-roles"); readAttribute.assertSuccess("Read operation for map-groups-to-roles failed"); Assert.assertEquals( "Read operation for map-groups-to-roles return wrong value", "true", readAttribute.stringValue()); }
@Test public void updateTopicsJndiNames() throws InterruptedException, TimeoutException, IOException { page.getConfig().topicsConfig(); page.selectInTable(TOPIC); String jndiName = "java:/jndi-name" + RandomStringUtils.randomAlphanumeric(5); ConfigFragment editPanelFragment = page.getConfigFragment(); editPanelFragment.edit().text("entries", jndiName); boolean finished = editPanelFragment.save(); administration.reloadIfRequired(); assertTrue("Config should be saved and closed.", finished); ModelNodeResult result = operations.readAttribute(TOPIC_ADDRESS, "entries"); Assert.assertTrue(result.hasDefinedValue() && result.stringValue().contains(jndiName)); }
private boolean isServerRunning() throws IOException { ModelNodeResult result = ops.readAttribute(Address.root(), Constants.SERVER_STATE); result.assertDefinedValue(); return ServerState.isRunning(result.stringValue()); }