use of com.xilixir.fortniteapi.v2.Configuration in project graylog2-server by Graylog2.
the class BlockingBatchedESOutputTest method setUp.
@Before
public void setUp() throws Exception {
this.metricRegistry = new MetricRegistry();
this.journal = new NoopJournal();
this.config = new Configuration() {
@Override
public int getOutputBatchSize() {
return 3;
}
};
}
use of com.xilixir.fortniteapi.v2.Configuration in project graylog2-server by Graylog2.
the class LdapUserAuthenticatorTest method setUp.
@Before
public void setUp() throws Exception {
server = getLdapServer();
final LdapConnectionConfig ldapConfig = new LdapConnectionConfig();
ldapConfig.setLdapHost("localHost");
ldapConfig.setLdapPort(server.getPort());
ldapConfig.setName(ADMIN_DN);
ldapConfig.setCredentials(ADMIN_PASSWORD);
configuration = mock(Configuration.class);
when(configuration.getPasswordSecret()).thenReturn(PASSWORD_SECRET);
ldapConnector = new LdapConnector(10000);
ldapSettingsService = mock(LdapSettingsService.class);
userService = mock(UserService.class);
ldapSettings = new LdapSettingsImpl(configuration, mock(RoleService.class));
ldapSettings.setEnabled(true);
ldapSettings.setUri(URI.create("ldap://localhost:" + server.getPort()));
ldapSettings.setUseStartTls(false);
ldapSettings.setSystemUsername(ADMIN_DN);
ldapSettings.setSystemPassword(ADMIN_PASSWORD);
ldapSettings.setSearchBase("ou=users,dc=example,dc=com");
ldapSettings.setSearchPattern("(&(objectClass=posixAccount)(uid={0}))");
ldapSettings.setDisplayNameAttribute("cn");
ldapSettings.setActiveDirectory(false);
ldapSettings.setGroupSearchBase("ou=groups,dc=example,dc=com");
ldapSettings.setGroupIdAttribute("cn");
ldapSettings.setGroupSearchPattern("(|(objectClass=groupOfNames)(objectClass=posixGroup))");
}
use of com.xilixir.fortniteapi.v2.Configuration in project graylog2-server by Graylog2.
the class KafkaJournalTest method setUp.
@Before
public void setUp() throws IOException {
scheduler = new ScheduledThreadPoolExecutor(1);
scheduler.prestartCoreThread();
journalDirectory = temporaryFolder.newFolder();
final File nodeId = temporaryFolder.newFile("node-id");
Files.write(UUID.randomUUID().toString(), nodeId, StandardCharsets.UTF_8);
final Configuration configuration = new Configuration() {
@Override
public String getNodeIdFile() {
return nodeId.getAbsolutePath();
}
};
serverStatus = new ServerStatus(configuration, EnumSet.of(ServerStatus.Capability.MASTER), new EventBus("KafkaJournalTest"), NullAuditEventSender::new);
}
use of com.xilixir.fortniteapi.v2.Configuration in project hadoop by apache.
the class TestMetricsConfig method testCommon.
/**
* Common use cases
* @throws Exception
*/
@Test
public void testCommon() throws Exception {
String filename = getTestFilename("test-metrics2");
new ConfigBuilder().add("*.foo", "default foo").add("p1.*.bar", "p1 default bar").add("p1.t1.*.bar", "p1.t1 default bar").add("p1.t1.i1.name", "p1.t1.i1.name").add("p1.t1.42.bar", "p1.t1.42.bar").add("p1.t2.i1.foo", "p1.t2.i1.foo").add("p2.*.foo", "p2 default foo").save(filename);
MetricsConfig mc = MetricsConfig.create("p1", filename);
LOG.debug("mc:" + mc);
Configuration expected = new ConfigBuilder().add("*.bar", "p1 default bar").add("t1.*.bar", "p1.t1 default bar").add("t1.i1.name", "p1.t1.i1.name").add("t1.42.bar", "p1.t1.42.bar").add("t2.i1.foo", "p1.t2.i1.foo").config;
assertEq(expected, mc);
testInstances(mc);
}
use of com.xilixir.fortniteapi.v2.Configuration in project hadoop by apache.
the class TestMetricsConfig method testLoadFirst.
/**
* Test the config file load order
* @throws Exception
*/
@Test
public void testLoadFirst() throws Exception {
String filename = getTestFilename("hadoop-metrics2-p1");
new ConfigBuilder().add("p1.foo", "p1foo").save(filename);
MetricsConfig mc = MetricsConfig.create("p1");
MetricsConfig mc2 = MetricsConfig.create("p1", "na1", "na2", filename);
Configuration expected = new ConfigBuilder().add("foo", "p1foo").config;
assertEq(expected, mc);
assertEq(expected, mc2);
}
Aggregations