java.util.Properties

Here are the examples of the java api class java.util.Properties taken from open source projects.

1. XmlOutput#defaultHtmlPatterns()

Project: jbehave-core
Source File: XmlOutput.java
View license
private static Properties defaultHtmlPatterns() {
    Properties patterns = new Properties();
    patterns.setProperty("dryRun", "<dryRun>{0}</dryRun>\n");
    patterns.setProperty("beforeStory", "<story path=\"{1}\" title=\"{0}\">\n");
    patterns.setProperty("storyCancelled", "<cancelled keyword=\"{0}\" durationKeyword=\"{1}\" durationInSecs=\"{2}\"/>\n");
    patterns.setProperty("afterStory", "</story>\n");
    patterns.setProperty("pendingMethod", "<pendingMethod>{0}</pendingMethod>\n");
    patterns.setProperty("metaStart", "<meta>\n");
    patterns.setProperty("metaProperty", "<property keyword=\"{0}\" name=\"{1}\" value=\"{2}\"/>\n");
    patterns.setProperty("metaEnd", "</meta>\n");
    patterns.setProperty("filter", "<filter>{0}</filter>\n");
    patterns.setProperty("narrative", "<narrative keyword=\"{0}\">\n  <inOrderTo keyword=\"{1}\">{2}</inOrderTo>\n  <asA keyword=\"{3}\">{4}</asA>\n  <iWantTo keyword=\"{5}\">{6}</iWantTo>\n</narrative>\n");
    patterns.setProperty("lifecycleStart", "<lifecycle keyword=\"{0}\">\n");
    patterns.setProperty("lifecycleEnd", "</lifecycle>\n");
    patterns.setProperty("lifecycleBeforeStart", "<before keyword=\"{0}\">\n");
    patterns.setProperty("lifecycleBeforeEnd", "</before>\n");
    patterns.setProperty("lifecycleAfterStart", "<after keyword=\"{0}\">\n");
    patterns.setProperty("lifecycleAfterEnd", "</after>\n");
    patterns.setProperty("lifecycleOutcome", "<outcome>{0} {1}</outcome>\n");
    patterns.setProperty("lifecycleMetaFilter", "<metaFilter>{0} {1}</metaFilter>");
    patterns.setProperty("lifecycleStep", "<step>{0}</step>\n");
    patterns.setProperty("beforeScenario", "<scenario keyword=\"{0}\" title=\"{1}\">\n");
    patterns.setProperty("scenarioNotAllowed", "<notAllowed pattern=\"{0}\"/>\n");
    patterns.setProperty("afterScenario", "</scenario>\n");
    patterns.setProperty("afterScenarioWithFailure", "<failure>{0}</failure>\n</scenario>\n");
    patterns.setProperty("givenStories", "<givenStories keyword=\"{0}\" paths=\"{1}\"/>\n");
    patterns.setProperty("givenStoriesStart", "<givenStories keyword=\"{0}\">\n");
    patterns.setProperty("givenStory", "<givenStory parameters=\"{1}\">{0}</givenStory>\n");
    patterns.setProperty("givenStoriesEnd", "</givenStories>\n");
    patterns.setProperty("successful", "<step outcome=\"successful\">{0}</step>\n");
    patterns.setProperty("ignorable", "<step outcome=\"ignorable\">{0}</step>\n");
    patterns.setProperty("pending", "<step outcome=\"pending\" keyword=\"{1}\">{0}</step>\n");
    patterns.setProperty("notPerformed", "<step outcome=\"notPerformed\" keyword=\"{1}\">{0}</step>\n");
    patterns.setProperty("failed", "<step outcome=\"failed\" keyword=\"{1}\">{0}<failure>{2}</failure></step>\n");
    patterns.setProperty("restarted", "<step outcome=\"restarted\">{0}<reason>{1}</reason></step>\n");
    patterns.setProperty("restartedStory", "<story outcome=\"restartedStory\">{0}<reason>{1}</reason></story>\n");
    patterns.setProperty("outcomesTableStart", "<outcomes>\n");
    patterns.setProperty("outcomesTableHeadStart", "<fields>");
    patterns.setProperty("outcomesTableHeadCell", "<field>{0}</field>");
    patterns.setProperty("outcomesTableHeadEnd", "</fields>\n");
    patterns.setProperty("outcomesTableBodyStart", "");
    patterns.setProperty("outcomesTableRowStart", "<outcome>");
    patterns.setProperty("outcomesTableCell", "<value>{0}</value>");
    patterns.setProperty("outcomesTableRowEnd", "</outcome>\n");
    patterns.setProperty("outcomesTableBodyEnd", "");
    patterns.setProperty("outcomesTableEnd", "</outcomes>\n");
    patterns.setProperty("beforeExamples", "<examples keyword=\"{0}\">\n");
    patterns.setProperty("examplesStep", "<step>{0}</step>\n");
    patterns.setProperty("afterExamples", "</examples>\n");
    patterns.setProperty("examplesTableStart", "<parameters>\n");
    patterns.setProperty("examplesTableHeadStart", "<names>");
    patterns.setProperty("examplesTableHeadCell", "<name>{0}</name>");
    patterns.setProperty("examplesTableHeadEnd", "</names>\n");
    patterns.setProperty("examplesTableBodyStart", "");
    patterns.setProperty("examplesTableRowStart", "<values>");
    patterns.setProperty("examplesTableCell", "<value>{0}</value>");
    patterns.setProperty("examplesTableRowEnd", "</values>\n");
    patterns.setProperty("examplesTableBodyEnd", "");
    patterns.setProperty("examplesTableEnd", "</parameters>\n");
    patterns.setProperty("example", "\n<example keyword=\"{0}\">{1}</example>\n");
    patterns.setProperty("parameterValueStart", "<parameter>");
    patterns.setProperty("parameterValueEnd", "</parameter>");
    patterns.setProperty("parameterValueNewline", "\n");
    return patterns;
}

2. HtmlOutput#defaultHtmlPatterns()

Project: jbehave-core
Source File: HtmlOutput.java
View license
private static Properties defaultHtmlPatterns() {
    Properties patterns = new Properties();
    patterns.setProperty("dryRun", "<div class=\"dryRun\">{0}</div>\n");
    patterns.setProperty("beforeStory", "<div class=\"story\">\n<h1>{0}</h1>\n<div class=\"path\">{1}</div>\n");
    patterns.setProperty("storyCancelled", "<div class=\"cancelled\">{0} ({1} {2} s)</div>\n");
    patterns.setProperty("afterStory", "</div>\n");
    patterns.setProperty("pendingMethod", "<div><pre class=\"pending\">{0}</pre></div>\n");
    patterns.setProperty("metaStart", "<div class=\"meta\">\n<div class=\"keyword\">{0}</div>\n");
    patterns.setProperty("metaProperty", "<div class=\"property\">{0}{1} {2}</div>\n");
    patterns.setProperty("metaEnd", "</div>\n");
    patterns.setProperty("filter", "<div class=\"filter\">{0}</div>\n");
    patterns.setProperty("narrative", "<div class=\"narrative\"><h2>{0}</h2>\n<div class=\"element inOrderTo\"><span class=\"keyword inOrderTo\">{1}</span> {2}</div>\n<div class=\"element asA\"><span class=\"keyword asA\">{3}</span> {4}</div>\n<div class=\"element iWantTo\"><span class=\"keyword iWantTo\">{5}</span> {6}</div>\n</div>\n");
    patterns.setProperty("lifecycleStart", "<div class=\"lifecycle\"><h2>{0}</h2>");
    patterns.setProperty("lifecycleEnd", "</div>");
    patterns.setProperty("lifecycleBeforeStart", "<div class=\"before\"><h3>{0}</h3>");
    patterns.setProperty("lifecycleBeforeEnd", "</div>");
    patterns.setProperty("lifecycleAfterStart", "<div class=\"after\"><h3>{0}</h3>");
    patterns.setProperty("lifecycleAfterEnd", "</div>");
    patterns.setProperty("lifecycleOutcome", "<div class=\"outcome\">{0} {1}</div>");
    patterns.setProperty("lifecycleMetaFilter", "<div class=\"metaFilter step\">{0} {1}</div>");
    patterns.setProperty("lifecycleStep", "<div class=\"step\">{0}</div>\n");
    patterns.setProperty("beforeScenario", "<div class=\"scenario\">\n<h2>{0} {1}</h2>\n");
    patterns.setProperty("afterScenario", "</div>\n");
    patterns.setProperty("afterScenarioWithFailure", "<pre class=\"failure\">{0}</pre>\n</div>\n");
    patterns.setProperty("givenStories", "<div class=\"givenStories\">{0} {1}</div>\n");
    patterns.setProperty("givenStoriesStart", "<div class=\"givenStories\">{0}\n");
    patterns.setProperty("givenStory", "<div class=\"givenStory\">{0} {1}</div>\n");
    patterns.setProperty("givenStoriesEnd", "</div>\n");
    patterns.setProperty("successful", "<div class=\"step successful\">{0}</div>\n");
    patterns.setProperty("ignorable", "<div class=\"step ignorable\">{0}</div>\n");
    patterns.setProperty("pending", "<div class=\"step pending\">{0} <span class=\"keyword pending\">({1})</span></div>\n");
    patterns.setProperty("notPerformed", "<div class=\"step notPerformed\">{0} <span class=\"keyword notPerformed\">({1})</span></div>\n");
    patterns.setProperty("failed", "<div class=\"step failed\">{0} <span class=\"keyword failed\">({1})</span><br/><span class=\"message failed\">{2}</span></div>\n");
    patterns.setProperty("restarted", "<div class=\"step restarted\">{0} <span class=\"message restarted\">{1}</span></div>\n");
    patterns.setProperty("restartedStory", "<div class=\"story restarted\">{0} <span class=\"message restarted\">{1}</span></div>\n");
    patterns.setProperty("outcomesTableStart", "<div class=\"outcomes\"><table>\n");
    patterns.setProperty("outcomesTableHeadStart", "<thead>\n<tr>\n");
    patterns.setProperty("outcomesTableHeadCell", "<th>{0}</th>");
    patterns.setProperty("outcomesTableHeadEnd", "</tr>\n</thead>\n");
    patterns.setProperty("outcomesTableBodyStart", "<tbody>\n");
    patterns.setProperty("outcomesTableRowStart", "<tr class=\"{0}\">\n");
    patterns.setProperty("outcomesTableCell", "<td>{0}</td>");
    patterns.setProperty("outcomesTableRowEnd", "</tr>\n");
    patterns.setProperty("outcomesTableBodyEnd", "</tbody>\n");
    patterns.setProperty("outcomesTableEnd", "</table></div>\n");
    patterns.setProperty("beforeExamples", "<div class=\"examples\">\n<h3>{0}</h3>\n");
    patterns.setProperty("examplesStep", "<div class=\"step\">{0}</div>\n");
    patterns.setProperty("afterExamples", "</div>\n");
    patterns.setProperty("examplesTableStart", "<table>\n");
    patterns.setProperty("examplesTableHeadStart", "<thead>\n<tr>\n");
    patterns.setProperty("examplesTableHeadCell", "<th>{0}</th>");
    patterns.setProperty("examplesTableHeadEnd", "</tr>\n</thead>\n");
    patterns.setProperty("examplesTableBodyStart", "<tbody>\n");
    patterns.setProperty("examplesTableRowStart", "<tr>\n");
    patterns.setProperty("examplesTableCell", "<td>{0}</td>");
    patterns.setProperty("examplesTableRowEnd", "</tr>\n");
    patterns.setProperty("examplesTableBodyEnd", "</tbody>\n");
    patterns.setProperty("examplesTableEnd", "</table>\n");
    patterns.setProperty("example", "\n<h3 class=\"example\">{0} {1}</h3>\n");
    patterns.setProperty("parameterValueStart", "<span class=\"step parameter\">");
    patterns.setProperty("parameterValueEnd", "</span>");
    patterns.setProperty("parameterValueNewline", "<br/>");
    return patterns;
}

3. TxtOutput#defaultPatterns()

Project: jbehave-core
Source File: TxtOutput.java
View license
private static Properties defaultPatterns() {
    Properties patterns = new Properties();
    patterns.setProperty("dryRun", "{0}\n");
    patterns.setProperty("storyCancelled", "{0} ({1} {2} s)\n");
    patterns.setProperty("beforeStory", "{0}\n({1})\n");
    patterns.setProperty("afterStory", "\n");
    patterns.setProperty("metaStart", "{0}\n");
    patterns.setProperty("metaProperty", "{0}{1} {2}\n");
    patterns.setProperty("metaEnd", "\n");
    patterns.setProperty("filter", "{0}\n");
    patterns.setProperty("narrative", "{0}\n{1} {2}\n{3} {4}\n{5} {6}\n");
    patterns.setProperty("beforeScenario", "{0} {1}\n");
    patterns.setProperty("afterScenario", "\n");
    patterns.setProperty("afterScenarioWithFailure", "\n{0}\n");
    patterns.setProperty("givenStories", "{0} {1}\n");
    patterns.setProperty("givenStoriesStart", "{0}\n");
    patterns.setProperty("givenStory", "{0} {1}\n");
    patterns.setProperty("givenStoriesEnd", "\n");
    patterns.setProperty("successful", "{0}\n");
    patterns.setProperty("ignorable", "{0}\n");
    patterns.setProperty("pending", "{0} ({1})\n");
    patterns.setProperty("notPerformed", "{0} ({1})\n");
    patterns.setProperty("failed", "{0} ({1})\n({2})\n");
    patterns.setProperty("restarted", "{0} ({1})\n");
    patterns.setProperty("restartedStory", "{0} ({1})\n");
    patterns.setProperty("outcomesTableStart", "");
    patterns.setProperty("outcomesTableHeadStart", "|");
    patterns.setProperty("outcomesTableHeadCell", "{0}|");
    patterns.setProperty("outcomesTableHeadEnd", "\n");
    patterns.setProperty("outcomesTableBodyStart", "");
    patterns.setProperty("outcomesTableRowStart", "|");
    patterns.setProperty("outcomesTableCell", "{0}|");
    patterns.setProperty("outcomesTableRowEnd", "\n");
    patterns.setProperty("outcomesTableBodyEnd", "");
    patterns.setProperty("outcomesTableEnd", "");
    patterns.setProperty("beforeExamples", "{0}\n");
    patterns.setProperty("examplesStep", "{0}\n");
    patterns.setProperty("afterExamples", "\n");
    patterns.setProperty("examplesTableStart", "\n");
    patterns.setProperty("examplesTableHeadStart", "|");
    patterns.setProperty("examplesTableHeadCell", "{0}|");
    patterns.setProperty("examplesTableHeadEnd", "\n");
    patterns.setProperty("examplesTableBodyStart", "");
    patterns.setProperty("examplesTableRowStart", "|");
    patterns.setProperty("examplesTableCell", "{0}|");
    patterns.setProperty("examplesTableRowEnd", "\n");
    patterns.setProperty("examplesTableBodyEnd", "");
    patterns.setProperty("examplesTableEnd", "");
    patterns.setProperty("example", "\n{0} {1}\n");
    patterns.setProperty("parameterValueStart", "");
    patterns.setProperty("parameterValueEnd", "");
    patterns.setProperty("parameterValueNewline", "\n");
    return patterns;
}

4. KafkaWeaveRunnable#generateKafkaConfig()

Project: weave
Source File: KafkaWeaveRunnable.java
View license
private Properties generateKafkaConfig(String zkConnectStr) {
    int port = Networks.getRandomPort();
    Preconditions.checkState(port > 0, "Failed to get random port.");
    Properties prop = new Properties();
    prop.setProperty("log.dir", new File("kafka-logs").getAbsolutePath());
    prop.setProperty("zk.connect", zkConnectStr);
    prop.setProperty("num.threads", "8");
    prop.setProperty("port", Integer.toString(port));
    prop.setProperty("log.flush.interval", "10000");
    prop.setProperty("max.socket.request.bytes", "104857600");
    prop.setProperty("log.cleanup.interval.mins", "1");
    prop.setProperty("log.default.flush.scheduler.interval.ms", "1000");
    prop.setProperty("zk.connectiontimeout.ms", "1000000");
    prop.setProperty("socket.receive.buffer", "1048576");
    prop.setProperty("enable.zookeeper", "true");
    prop.setProperty("log.retention.hours", "168");
    prop.setProperty("brokerid", "0");
    prop.setProperty("socket.send.buffer", "1048576");
    prop.setProperty("num.partitions", "1");
    prop.setProperty("log.file.size", "536870912");
    prop.setProperty("log.default.flush.interval.ms", "1000");
    return prop;
}

5. KafkaTest#generateKafkaConfig()

Project: weave
Source File: KafkaTest.java
View license
private static Properties generateKafkaConfig(String zkConnectStr) throws IOException {
    int port = Networks.getRandomPort();
    Preconditions.checkState(port > 0, "Failed to get random port.");
    Properties prop = new Properties();
    prop.setProperty("log.dir", TMP_FOLDER.newFolder().getAbsolutePath());
    prop.setProperty("zk.connect", zkConnectStr);
    prop.setProperty("num.threads", "8");
    prop.setProperty("port", Integer.toString(port));
    prop.setProperty("log.flush.interval", "1000");
    prop.setProperty("max.socket.request.bytes", "104857600");
    prop.setProperty("log.cleanup.interval.mins", "1");
    prop.setProperty("log.default.flush.scheduler.interval.ms", "1000");
    prop.setProperty("zk.connectiontimeout.ms", "1000000");
    prop.setProperty("socket.receive.buffer", "1048576");
    prop.setProperty("enable.zookeeper", "true");
    prop.setProperty("log.retention.hours", "24");
    prop.setProperty("brokerid", "0");
    prop.setProperty("socket.send.buffer", "1048576");
    prop.setProperty("num.partitions", "1");
    // Use a really small file size to force some flush to happen
    prop.setProperty("log.file.size", "1024");
    prop.setProperty("log.default.flush.interval.ms", "1000");
    return prop;
}

6. ApplicationMasterService#generateKafkaConfig()

Project: weave
Source File: ApplicationMasterService.java
View license
private Properties generateKafkaConfig() {
    int port = Networks.getRandomPort();
    Preconditions.checkState(port > 0, "Failed to get random port.");
    Properties prop = new Properties();
    prop.setProperty("log.dir", new File("kafka-logs").getAbsolutePath());
    prop.setProperty("zk.connect", getKafkaZKConnect());
    prop.setProperty("num.threads", "8");
    prop.setProperty("port", Integer.toString(port));
    prop.setProperty("log.flush.interval", "10000");
    prop.setProperty("max.socket.request.bytes", "104857600");
    prop.setProperty("log.cleanup.interval.mins", "1");
    prop.setProperty("log.default.flush.scheduler.interval.ms", "1000");
    prop.setProperty("zk.connectiontimeout.ms", "1000000");
    prop.setProperty("socket.receive.buffer", "1048576");
    prop.setProperty("enable.zookeeper", "true");
    prop.setProperty("log.retention.hours", "24");
    prop.setProperty("brokerid", "0");
    prop.setProperty("socket.send.buffer", "1048576");
    prop.setProperty("num.partitions", "1");
    prop.setProperty("log.file.size", "536870912");
    prop.setProperty("log.default.flush.interval.ms", "1000");
    return prop;
}

7. ToolUtils#createSSLProperties()

Project: ambry
Source File: ToolUtils.java
View license
public static Properties createSSLProperties(String sslEnabledDatacenters, String sslKeystorePath, String sslKeyStoreType, String sslKeystorePassword, String keyPassword, String sslTruststorePath, String sslTruststorePassword, String sslCipherSuites) {
    Properties props = new Properties();
    props.put("ssl.context.protocol", "TLS");
    props.put("ssl.context.provider", "SunJSSE");
    props.put("ssl.enabled.protocols", "TLSv1.2");
    props.put("ssl.endpoint.identification.algorithm", "HTTPS");
    props.put("ssl.client.authentication", "required");
    props.put("ssl.keymanager.algorithm", "PKIX");
    props.put("ssl.trustmanager.algorithm", "PKIX");
    props.put("ssl.keystore.type", sslKeyStoreType);
    props.put("ssl.keystore.path", sslKeystorePath);
    props.put("ssl.keystore.password", sslKeystorePassword);
    props.put("ssl.key.password", keyPassword);
    props.put("ssl.truststore.type", "JKS");
    props.put("ssl.truststore.path", sslTruststorePath);
    props.put("ssl.truststore.password", sslTruststorePassword);
    props.put("ssl.cipher.suites", sslCipherSuites);
    props.put("ssl.enabled.datacenters", sslEnabledDatacenters);
    return props;
}

8. KafkaTester#generateKafkaConfig()

Project: cdap
Source File: KafkaTester.java
View license
private Properties generateKafkaConfig(int port) throws IOException {
    Properties properties = new Properties();
    properties.setProperty("broker.id", "1");
    properties.setProperty("port", Integer.toString(port));
    properties.setProperty("num.network.threads", "2");
    properties.setProperty("num.io.threads", "2");
    properties.setProperty("socket.send.buffer.bytes", "1048576");
    properties.setProperty("socket.receive.buffer.bytes", "1048576");
    properties.setProperty("socket.request.max.bytes", "104857600");
    properties.setProperty("log.dir", tmpFolder.newFolder().getAbsolutePath());
    properties.setProperty("num.partitions", String.valueOf(numPartitions));
    properties.setProperty("log.flush.interval.messages", "10000");
    properties.setProperty("log.flush.interval.ms", "1000");
    properties.setProperty("log.retention.hours", "1");
    properties.setProperty("log.segment.bytes", "536870912");
    properties.setProperty("log.cleanup.interval.mins", "1");
    properties.setProperty("zookeeper.connect", zkServer.getConnectionStr());
    properties.setProperty("zookeeper.connection.timeout.ms", "1000000");
    return properties;
}

9. KafkaMetricsCollectionServiceTest#generateKafkaConfig()

View license
private Properties generateKafkaConfig(TemporaryFolder tmpFolder) throws IOException {
    int port = Networks.getRandomPort();
    Preconditions.checkState(port > 0, "Failed to get random port.");
    Properties prop = new Properties();
    prop.setProperty("broker.id", "1");
    prop.setProperty("port", Integer.toString(port));
    prop.setProperty("num.network.threads", "2");
    prop.setProperty("num.io.threads", "2");
    prop.setProperty("socket.send.buffer.bytes", "1048576");
    prop.setProperty("socket.receive.buffer.bytes", "1048576");
    prop.setProperty("socket.request.max.bytes", "104857600");
    prop.setProperty("log.dir", tmpFolder.newFolder().getAbsolutePath());
    prop.setProperty("num.partitions", "1");
    prop.setProperty("log.flush.interval.messages", "10000");
    prop.setProperty("log.flush.interval.ms", "1000");
    prop.setProperty("log.retention.hours", "1");
    prop.setProperty("log.segment.bytes", "536870912");
    prop.setProperty("log.cleanup.interval.mins", "1");
    prop.setProperty("zookeeper.connect", zkServer.getConnectionStr());
    prop.setProperty("zookeeper.connection.timeout.ms", "1000000");
    return prop;
}

10. KafkaTest#generateKafkaConfig()

Project: incubator-twill
Source File: KafkaTest.java
View license
private static Properties generateKafkaConfig(String zkConnectStr, File logDir) throws IOException {
    int port = Networks.getRandomPort();
    Preconditions.checkState(port > 0, "Failed to get random port.");
    Properties prop = new Properties();
    prop.setProperty("log.dir", logDir.getAbsolutePath());
    prop.setProperty("port", Integer.toString(port));
    prop.setProperty("broker.id", "1");
    prop.setProperty("socket.send.buffer.bytes", "1048576");
    prop.setProperty("socket.receive.buffer.bytes", "1048576");
    prop.setProperty("socket.request.max.bytes", "104857600");
    prop.setProperty("num.partitions", "1");
    prop.setProperty("log.retention.hours", "1");
    prop.setProperty("log.flush.interval.messages", "10000");
    prop.setProperty("log.flush.interval.ms", "1000");
    prop.setProperty("log.segment.bytes", "536870912");
    prop.setProperty("zookeeper.connect", zkConnectStr);
    prop.setProperty("zookeeper.connection.timeout.ms", "1000000");
    prop.setProperty("default.replication.factor", "1");
    // Use a really small file size to force some flush to happen
    prop.setProperty("log.file.size", "1024");
    prop.setProperty("log.default.flush.interval.ms", "1000");
    return prop;
}

11. PropertiesUtilTest#removeKeyPrefix()

Project: asakusafw
Source File: PropertiesUtilTest.java
View license
/**
     * Test method for [email protected] PropertiesUtil#removeKeyPrefix(java.util.Properties, java.lang.String)}.
     */
@Test
public void removeKeyPrefix() {
    Properties properties = new Properties();
    properties.put("abcde", "abcde");
    properties.put("abc0", "abc0");
    properties.put("abc", "abc");
    properties.put("ab", "ab");
    properties.put("abbde", "abbde");
    properties.put("abd", "abd");
    properties.put("bcdef", "bcdef");
    char[] array = "abc[]".toCharArray();
    properties.put(array, "abc[]");
    properties.put("abc[]", array);
    Properties answer = new Properties();
    answer.put("ab", "ab");
    answer.put("abbde", "abbde");
    answer.put("abd", "abd");
    answer.put("bcdef", "bcdef");
    answer.put(array, "abc[]");
    PropertiesUtil.removeKeyPrefix(properties, "abc");
    assertThat(properties, is(answer));
}

12. TestBasicDataSourceFactory#getTestProperties()

View license
private Properties getTestProperties() {
    final Properties properties = new Properties();
    properties.setProperty("driverClassName", "org.apache.commons.dbcp2.TesterDriver");
    properties.setProperty("url", "jdbc:apache:commons:testdriver");
    properties.setProperty("maxTotal", "10");
    properties.setProperty("maxIdle", "8");
    properties.setProperty("minIdle", "0");
    properties.setProperty("maxWaitMillis", "500");
    properties.setProperty("initialSize", "5");
    properties.setProperty("defaultAutoCommit", "true");
    properties.setProperty("defaultReadOnly", "false");
    properties.setProperty("defaultTransactionIsolation", "READ_COMMITTED");
    properties.setProperty("defaultCatalog", "test");
    properties.setProperty("testOnBorrow", "true");
    properties.setProperty("testOnReturn", "false");
    properties.setProperty("username", "username");
    properties.setProperty("password", "password");
    properties.setProperty("validationQuery", "SELECT DUMMY FROM DUAL");
    properties.setProperty("validationQueryTimeout", "100");
    properties.setProperty("connectionInitSqls", "SELECT 1;SELECT 2");
    properties.setProperty("timeBetweenEvictionRunsMillis", "1000");
    properties.setProperty("minEvictableIdleTimeMillis", "2000");
    properties.setProperty("softMinEvictableIdleTimeMillis", "3000");
    properties.setProperty("numTestsPerEvictionRun", "2");
    properties.setProperty("testWhileIdle", "true");
    properties.setProperty("accessToUnderlyingConnectionAllowed", "true");
    properties.setProperty("removeAbandonedOnBorrow", "true");
    properties.setProperty("removeAbandonedOnMaintenance", "true");
    properties.setProperty("removeAbandonedTimeout", "3000");
    properties.setProperty("logAbandoned", "true");
    properties.setProperty("abandonedUsageTracking", "true");
    properties.setProperty("poolPreparedStatements", "true");
    properties.setProperty("maxOpenPreparedStatements", "10");
    properties.setProperty("lifo", "true");
    properties.setProperty("fastFailValidation", "true");
    properties.setProperty("disconnectionSqlCodes", "XXX,YYY");
    properties.setProperty("jmxName", "org.apache.commons.dbcp2:name=test");
    return properties;
}

13. TestAuthorize#createKafkaConsumer()

Project: incubator-sentry
Source File: TestAuthorize.java
View license
private KafkaConsumer<String, String> createKafkaConsumer(String user) {
    Properties props = new Properties();
    props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
    props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
    props.put(ConsumerConfig.GROUP_ID_CONFIG, "sentrykafkaconsumer");
    props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true");
    props.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000");
    props.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "30000");
    props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
    props.put(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "JKS");
    props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".keystore.jks").getPath());
    props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, user + "-ks-passwd");
    props.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, user + "-key-passwd");
    props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".truststore.jks").getPath());
    props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, user + "-ts-passwd");
    return new KafkaConsumer<String, String>(props);
}

14. LTI2SampleData#getSubstitution()

Project: sakai
Source File: LTI2SampleData.java
View license
public static Properties getSubstitution() {
    Properties lti2subst = new Properties();
    lti2subst.setProperty(LTI2Vars.COURSESECTION_SOURCEDID, "context_id_999");
    lti2subst.setProperty(LTI2Vars.COURSESECTION_LABEL, "SI364");
    lti2subst.setProperty(LTI2Vars.COURSESECTION_TITLE, "Building Interactive Applications");
    lti2subst.setProperty(LTI2Vars.CONTEXT_ID, "context_id_999");
    lti2subst.setProperty(LTI2Vars.CONTEXT_LABEL, "SI364");
    lti2subst.setProperty(LTI2Vars.CONTEXT_TITLE, "Building Interactive Applications");
    lti2subst.setProperty(LTI2Vars.MEMBERSHIP_ROLE, "Instructor");
    lti2subst.setProperty(LTI2Vars.RESOURCELINK_ID, "res_link_999");
    lti2subst.setProperty(LTI2Vars.RESOURCELINK_TITLE, "My weekly blog");
    lti2subst.setProperty(LTI2Vars.USER_ID, "user_id_007");
    lti2subst.setProperty(LTI2Vars.USER_USERNAME, "bond");
    lti2subst.setProperty(LTI2Vars.PERSON_NAME_GIVEN, "James");
    lti2subst.setProperty(LTI2Vars.PERSON_NAME_FAMILY, "Bond");
    ;
    lti2subst.setProperty(LTI2Vars.PERSON_NAME_FULL, "James Bond");
    lti2subst.setProperty(LTI2Vars.PERSON_EMAIL_PRIMARY, "[email protected]");
    return lti2subst;
}

15. LTI2Util#property2CapabilityMapping()

Project: sakai
Source File: LTI2Util.java
View license
/* From Stephen Vickers - mod/lti/locallib.php in Moodle
	      'Context.id' => 'context_id',
	      'Context.type' => 'context_type',
	      'CourseSection.title' => 'context_title',
	      'CourseSection.label' => 'context_label',
	      'CourseSection.sourcedId' => 'lis_course_section_sourcedid',
	      'ResourceLink.id' => 'resource_link_id',
	      'ResourceLink.title' => 'resource_link_title',
	      'ResourceLink.description' => 'resource_link_description',
	      'User.id' => 'user_id',
	      'Person.name.full' => 'lis_person_name_full',
	      'Person.name.given' => 'lis_person_name_given',
	      'Person.name.family' => 'lis_person_name_family',
	      'Person.email.primary' => 'lis_person_contact_email_primary',
	      'Person.sourcedId' => 'lis_person_sourcedid',
	      'Membership.role' => 'roles',
	      'BasicOutcome.sourcedId' => 'lis_result_sourcedid',
	      'BasicOutcome.url' => 'lis_outcome_service_url'
	*/
public static Properties property2CapabilityMapping() {
    Properties mapping = new Properties();
    mapping.setProperty("context_title", "CourseSection.title");
    mapping.setProperty("context_label", "CourseSection.label");
    mapping.setProperty("lis_course_section_sourcedid", "CourseSection.sourcedId");
    mapping.setProperty("resource_link_id", "ResourceLink.id");
    mapping.setProperty("resource_link_title", "ResourceLink.title");
    mapping.setProperty("resource_link_description", "ResourceLink.description");
    mapping.setProperty("lis_person_name_full", "Person.name.full");
    mapping.setProperty("lis_person_name_given", "Person.name.given");
    mapping.setProperty("lis_person_name_family", "Person.name.family");
    mapping.setProperty("lis_person_contact_email_primary", "Person.email.primary");
    mapping.setProperty("lis_person_sourcedid", "Person.sourcedId");
    mapping.setProperty("lis_result_sourcedid", LTI2Vars.BASICOUTCOME_SOURCEDID);
    mapping.setProperty("lis_outcome_service_url", LTI2Vars.BASICOUTCOME_URL);
    mapping.setProperty("launch_presentation_locale", LTI2Vars.MESSAGE_LOCALE);
    mapping.setProperty("roles", "Membership.role");
    return mapping;
}

16. TestAuthorize#createKafkaConsumer()

Project: sentry
Source File: TestAuthorize.java
View license
private KafkaConsumer<String, String> createKafkaConsumer(String user) {
    Properties props = new Properties();
    props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
    props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
    props.put(ConsumerConfig.GROUP_ID_CONFIG, "sentrykafkaconsumer");
    props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true");
    props.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000");
    props.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "30000");
    props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
    props.put(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "JKS");
    props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".keystore.jks").getPath());
    props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, user + "-ks-passwd");
    props.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, user + "-key-passwd");
    props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".truststore.jks").getPath());
    props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, user + "-ts-passwd");
    return new KafkaConsumer<String, String>(props);
}

17. Sample#initProps()

Project: lucene-solr
Source File: Sample.java
View license
// Sample programmatic settings. Could also read from file.
private static Properties initProps() {
    Properties p = new Properties();
    p.setProperty("task.max.depth.log", "3");
    p.setProperty("max.buffered", "buf:10:10:100:100:10:10:100:100");
    p.setProperty("doc.maker", "org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource");
    p.setProperty("log.step", "2000");
    p.setProperty("doc.delete.step", "8");
    p.setProperty("analyzer", "org.apache.lucene.analysis.standard.StandardAnalyzer");
    p.setProperty("doc.term.vector", "false");
    p.setProperty("directory", "FSDirectory");
    p.setProperty("query.maker", "org.apache.lucene.benchmark.byTask.feeds.ReutersQueryMaker");
    p.setProperty("doc.stored", "true");
    p.setProperty("docs.dir", "reuters-out");
    p.setProperty("compound", "cmpnd:true:true:true:true:false:false:false:false");
    p.setProperty("doc.tokenized", "true");
    p.setProperty("merge.factor", "mrg:10:100:10:100:10:100:10:100");
    return p;
}

18. SpamClassifierTest#generateKafkaConfig()

Project: cdap
Source File: SpamClassifierTest.java
View license
private static Properties generateKafkaConfig(String zkConnectStr, int port, File logDir) {
    Properties prop = new Properties();
    prop.setProperty("log.dir", logDir.getAbsolutePath());
    prop.setProperty("host.name", "127.0.0.1");
    prop.setProperty("port", Integer.toString(port));
    prop.setProperty("broker.id", KAFKA_BROKER_ID);
    prop.setProperty("socket.send.buffer.bytes", "1048576");
    prop.setProperty("socket.receive.buffer.bytes", "1048576");
    prop.setProperty("socket.request.max.bytes", "104857600");
    prop.setProperty("log.retention.hours", "24");
    prop.setProperty("log.flush.interval.messages", "10000");
    prop.setProperty("log.flush.interval.ms", "1000");
    prop.setProperty("log.segment.bytes", "536870912");
    prop.setProperty("zookeeper.connect", zkConnectStr);
    prop.setProperty("zookeeper.connection.timeout.ms", "1000000");
    prop.setProperty("default.replication.factor", "1");
    return prop;
}

19. EVCacheTestDI#getProps()

Project: EVCache
Source File: EVCacheTestDI.java
View license
protected Properties getProps() {
    Properties props = super.getProps();
    props.setProperty("EVCACHE.us-east-1d.EVCacheClientPool.writeOnly", "false");
    props.setProperty("EVCACHE.EVCacheClientPool.poolSize", "1");
    props.setProperty("EVCACHE.ping.servers", "false");
    props.setProperty("EVCACHE.cid.throw.exception", "true");
    props.setProperty("EVCACHE.EVCacheClientPool.readTimeout", "500");
    props.setProperty("EVCACHE.EVCacheClientPool.bulkReadTimeout", "500");
    props.setProperty("EVCACHE.evcache.max.read.queue.length", "20");
    props.setProperty("EVCacheClientPoolManager.log.apps", "EVCACHE");
    props.setProperty("EVCACHE.fallback.zone", "true");
    props.setProperty("EVCACHE.enable.throttling", "false");
    props.setProperty("EVCACHE.throttle.time", "0");
    props.setProperty("EVCACHE.throttle.percent", "0");
    props.setProperty("EVCACHE.log.operation", "1000");
    props.setProperty("EVCACHE.EVCacheClientPool.validate.input.queue", "true");
    return props;
}

20. PropertiesUserManagerTest#createUserFile()

View license
private void createUserFile() throws IOException {
    Properties users = new Properties();
    users.setProperty("ftpserver.user.user1.userpassword", "pw1");
    users.setProperty("ftpserver.user.user1.homedirectory", "home");
    users.setProperty("ftpserver.user.user2.userpassword", "pw2");
    users.setProperty("ftpserver.user.user2.homedirectory", "home");
    users.setProperty("ftpserver.user.user2.writepermission", "true");
    users.setProperty("ftpserver.user.user2.enableflag", "false");
    users.setProperty("ftpserver.user.user2.idletime", "2");
    users.setProperty("ftpserver.user.user2.uploadrate", "5");
    users.setProperty("ftpserver.user.user2.downloadrate", "1");
    users.setProperty("ftpserver.user.user2.maxloginnumber", "3");
    users.setProperty("ftpserver.user.user2.maxloginperip", "4");
    users.setProperty("ftpserver.user.user3.userpassword", "");
    users.setProperty("ftpserver.user.user3.homedirectory", "home");
    FileOutputStream fos = new FileOutputStream(USERS_FILE);
    users.store(fos, null);
    fos.close();
}

21. GateScriptTest#storeTo_multiple()

Project: asakusafw
Source File: GateScriptTest.java
View license
/**
     * Stores multiple processes.
     */
@Test
public void storeTo_multiple() {
    Properties p = new Properties();
    p.setProperty(k("test1", KEY_DATA_CLASS), String.class.getName());
    p.setProperty(k("test1", KEY_PROCESS_TYPE), "plain1");
    p.setProperty(k("test1", PREFIX_SOURCE), "ts1");
    p.setProperty(k("test1", PREFIX_DRAIN), "td1");
    p.setProperty(k("test2", KEY_DATA_CLASS), Integer.class.getName());
    p.setProperty(k("test2", KEY_PROCESS_TYPE), "plain2");
    p.setProperty(k("test2", PREFIX_SOURCE), "ts2");
    p.setProperty(k("test2", PREFIX_DRAIN), "td2");
    p.setProperty(k("test3", KEY_DATA_CLASS), Long.class.getName());
    p.setProperty(k("test3", KEY_PROCESS_TYPE), "plain3");
    p.setProperty(k("test3", PREFIX_SOURCE), "ts3");
    p.setProperty(k("test3", PREFIX_DRAIN), "td3");
    GateScript script = GateScript.loadFrom("testing", p, getClass().getClassLoader());
    Properties target = new Properties();
    script.storeTo(target);
    assertThat(target, is(p));
}

22. KafkaProducerFullTest#before()

Project: camel
Source File: KafkaProducerFullTest.java
View license
@BeforeClass
public static void before() {
    Properties stringsProps = new Properties();
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:" + getKarfkaPort());
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.GROUP_ID_CONFIG, "DemoConsumer");
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true");
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000");
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "30000");
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
    stringsConsumerConn = new KafkaConsumer<String, String>(stringsProps);
    Properties bytesProps = new Properties();
    bytesProps.putAll(stringsProps);
    bytesProps.put("group.id", GROUP_BYTES);
    bytesProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArrayDeserializer");
    bytesProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArrayDeserializer");
    bytesConsumerConn = new KafkaConsumer<byte[], byte[]>(bytesProps);
}

23. FhirDbConfig#jpaProperties()

Project: hapi-fhir
Source File: FhirDbConfig.java
View license
@Bean()
public Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.dialect", org.hibernate.dialect.DerbyTenSevenDialect.class.getName());
    extraProperties.put("hibernate.format_sql", "true");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", "target/lucenefiles");
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    extraProperties.put("hibernate.search.default.worker.execution", "async");
    if (System.getProperty("lowmem") != null) {
        extraProperties.put("hibernate.search.autoregister_listeners", "false");
    }
    return extraProperties;
}

24. KafkaComponentTest#getProducerKeys()

Project: camel
Source File: KafkaComponentTest.java
View license
private Properties getProducerKeys() {
    Properties props = new Properties();
    props.put(ProducerConfig.ACKS_CONFIG, "1");
    props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, "33554432");
    props.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "none");
    props.put(ProducerConfig.RETRIES_CONFIG, "0");
    props.put(ProducerConfig.BATCH_SIZE_CONFIG, "16384");
    props.put(ProducerConfig.CONNECTIONS_MAX_IDLE_MS_CONFIG, "540000");
    props.put(ProducerConfig.LINGER_MS_CONFIG, "0");
    props.put(ProducerConfig.MAX_BLOCK_MS_CONFIG, "60000");
    props.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, "1048576");
    props.put(ProducerConfig.PARTITIONER_CLASS_CONFIG, KafkaConstants.KAFKA_DEFAULT_PARTITIONER);
    props.put(ProducerConfig.RECEIVE_BUFFER_CONFIG, "32768");
    props.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, "30000");
    props.put(ProducerConfig.SEND_BUFFER_CONFIG, "131072");
    props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, "5");
    props.put(ProducerConfig.METADATA_MAX_AGE_CONFIG, "300000");
    props.put(ProducerConfig.METRICS_NUM_SAMPLES_CONFIG, "2");
    props.put(ProducerConfig.METRICS_SAMPLE_WINDOW_MS_CONFIG, "30000");
    props.put(ProducerConfig.RECONNECT_BACKOFF_MS_CONFIG, "50");
    props.put(ProducerConfig.RETRY_BACKOFF_MS_CONFIG, "100");
    props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, KafkaConstants.KAFKA_DEFAULT_SERIALIZER);
    props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, KafkaConstants.KAFKA_DEFAULT_SERIALIZER);
    props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "PLAINTEXT");
    props.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, "TLSv1.2, TLSv1.1, TLSv1");
    props.put(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "JKS");
    props.put(SslConfigs.SSL_PROTOCOL_CONFIG, "TLS");
    props.put(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, "JKS");
    props.put(SaslConfigs.SASL_KERBEROS_KINIT_CMD, "/usr/bin/kinit");
    props.put(SaslConfigs.SASL_KERBEROS_MIN_TIME_BEFORE_RELOGIN, "60000");
    props.put(SaslConfigs.SASL_KERBEROS_TICKET_RENEW_JITTER, "0.05");
    props.put(SaslConfigs.SASL_KERBEROS_TICKET_RENEW_WINDOW_FACTOR, "0.8");
    props.put(SslConfigs.SSL_KEYMANAGER_ALGORITHM_CONFIG, "SunX509");
    props.put(SslConfigs.SSL_TRUSTMANAGER_ALGORITHM_CONFIG, "PKIX");
    return props;
}

25. FhirServerConfig#jpaProperties()

Project: hapi-fhir
Source File: FhirServerConfig.java
View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.dialect", org.hibernate.dialect.DerbyTenSevenDialect.class.getName());
    extraProperties.put("hibernate.format_sql", "true");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", "target/lucenefiles");
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    return extraProperties;
}

26. FhirServerConfigDstu3#jpaProperties()

View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.dialect", org.hibernate.dialect.DerbyTenSevenDialect.class.getName());
    extraProperties.put("hibernate.format_sql", "true");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", "target/lucenefiles");
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    //		extraProperties.put("hibernate.search.default.worker.execution", "async");
    return extraProperties;
}

27. JpaCacheConfiguration#jpaProperties()

View license
/**
   * JPA ?? ?? ??
   *
   * @return ?? ??
   */
public Properties jpaProperties() {
    Properties props = new Properties();
    props.put(Environment.FORMAT_SQL, "true");
    props.put(Environment.HBM2DDL_AUTO, "create");
    props.put(Environment.SHOW_SQL, "true");
    props.put(Environment.POOL_SIZE, 30);
    // Secondary Cache
    props.put(Environment.USE_SECOND_LEVEL_CACHE, true);
    props.put(Environment.USE_QUERY_CACHE, true);
    props.put(Environment.CACHE_REGION_FACTORY, SingletonRedisRegionFactory.class.getName());
    props.put(Environment.CACHE_REGION_PREFIX, "hibernate4");
    props.put(Environment.CACHE_PROVIDER_CONFIG, "conf/hibernate-redis.properties");
    props.setProperty(Environment.GENERATE_STATISTICS, "true");
    props.setProperty(Environment.USE_STRUCTURED_CACHE, "true");
    props.setProperty(Environment.TRANSACTION_STRATEGY, JdbcTransactionFactory.class.getName());
    return props;
}

28. HibernateRedisConfiguration#hibernateProperties()

View license
public Properties hibernateProperties() {
    Properties props = new Properties();
    props.put(Environment.FORMAT_SQL, "true");
    props.put(Environment.HBM2DDL_AUTO, "create");
    props.put(Environment.SHOW_SQL, "true");
    props.put(Environment.POOL_SIZE, 30);
    // Secondary Cache
    props.put(Environment.USE_SECOND_LEVEL_CACHE, true);
    props.put(Environment.USE_QUERY_CACHE, true);
    props.put(Environment.CACHE_REGION_FACTORY, SingletonRedisRegionFactory.class.getName());
    props.put(Environment.CACHE_REGION_PREFIX, "hibernate4");
    props.put(Environment.CACHE_PROVIDER_CONFIG, "conf/hibernate-redis.properties");
    props.setProperty(Environment.GENERATE_STATISTICS, "true");
    props.setProperty(Environment.USE_STRUCTURED_CACHE, "true");
    props.setProperty(Environment.TRANSACTION_STRATEGY, JdbcTransactionFactory.class.getName());
    return props;
}

29. JpaCacheConfiguration#jpaProperties()

View license
/**
   * JPA ?? ?? ??
   *
   * @return ?? ??
   */
public Properties jpaProperties() {
    Properties props = new Properties();
    props.put(Environment.FORMAT_SQL, "true");
    props.put(Environment.HBM2DDL_AUTO, "create");
    props.put(Environment.SHOW_SQL, "true");
    props.put(Environment.POOL_SIZE, 30);
    // Secondary Cache
    props.put(Environment.USE_SECOND_LEVEL_CACHE, true);
    props.put(Environment.USE_QUERY_CACHE, true);
    props.put(Environment.CACHE_REGION_FACTORY, SingletonRedisRegionFactory.class.getName());
    props.put(Environment.CACHE_REGION_PREFIX, "hibernate5");
    props.put(Environment.CACHE_PROVIDER_CONFIG, "conf/hibernate-redis.properties");
    props.setProperty(Environment.GENERATE_STATISTICS, "true");
    props.setProperty(Environment.USE_STRUCTURED_CACHE, "true");
    props.setProperty(Environment.TRANSACTION_COORDINATOR_STRATEGY, JtaTransactionCoordinatorBuilderImpl.class.getName());
    return props;
}

30. LogbackManager#registerWebConsoleSupport()

Project: sling
Source File: LogbackManager.java
View license
private void registerWebConsoleSupport() {
    final ServiceFactory serviceFactory = new PluginServiceFactory();
    Properties pluginProps = new Properties();
    pluginProps.put(Constants.SERVICE_VENDOR, "Apache Software Foundation");
    pluginProps.put(Constants.SERVICE_DESCRIPTION, "Sling Log Support");
    pluginProps.put("felix.webconsole.label", APP_ROOT);
    pluginProps.put("felix.webconsole.title", "Log Support");
    pluginProps.put("felix.webconsole.category", "Sling");
    pluginProps.put("felix.webconsole.css", CSS_REFS);
    registrations.add(bundleContext.registerService("javax.servlet.Servlet", serviceFactory, pluginProps));
    Properties printerProps = new Properties();
    printerProps.put(Constants.SERVICE_VENDOR, "Apache Software Foundation");
    printerProps.put(Constants.SERVICE_DESCRIPTION, "Sling Log Configuration Printer");
    printerProps.put("felix.webconsole.label", PRINTER_URL);
    printerProps.put("felix.webconsole.title", "Log Files");
    printerProps.put("felix.webconsole.configprinter.modes", "always");
    // TODO need to see to add support for Inventory Feature
    registrations.add(bundleContext.registerService(SlingConfigurationPrinter.class.getName(), new SlingConfigurationPrinter(this), printerProps));
}

31. LTI2SampleData#getLaunch()

Project: sakai
Source File: LTI2SampleData.java
View license
public static Properties getLaunch() {
    Properties launch = new Properties();
    launch.setProperty(BasicLTIConstants.CONTEXT_ID, "context_id_999");
    launch.setProperty(BasicLTIConstants.CONTEXT_LABEL, "SI364");
    launch.setProperty(BasicLTIConstants.CONTEXT_TITLE, "Building Interactive Applications");
    launch.setProperty(BasicLTIConstants.ROLES, "Instructor");
    launch.setProperty(BasicLTIConstants.RESOURCE_LINK_ID, "res_link_999");
    launch.setProperty(BasicLTIConstants.RESOURCE_LINK_TITLE, "My weekly blog");
    launch.setProperty(BasicLTIConstants.USER_ID, "user_id_007");
    launch.setProperty(BasicLTIConstants.LIS_PERSON_NAME_GIVEN, "James");
    launch.setProperty(BasicLTIConstants.LIS_PERSON_NAME_FAMILY, "Bond");
    ;
    launch.setProperty(BasicLTIConstants.LIS_PERSON_NAME_FULL, "James Bond");
    launch.setProperty(BasicLTIConstants.LIS_PERSON_CONTACT_EMAIL_PRIMARY, "[email protected]");
    return launch;
}

32. TestAuthorize#createKafkaProducer()

Project: sentry
Source File: TestAuthorize.java
View license
private KafkaProducer<String, String> createKafkaProducer(String user) {
    Properties props = new Properties();
    props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
    props.put(ProducerConfig.CLIENT_ID_CONFIG, "SentryKafkaProducer");
    props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
    props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
    props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
    props.put(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "JKS");
    props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".keystore.jks").getPath());
    props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, user + "-ks-passwd");
    props.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, user + "-key-passwd");
    props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".truststore.jks").getPath());
    props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, user + "-ts-passwd");
    return new KafkaProducer<String, String>(props);
}

33. Log4jAppender#createProperties()

Project: suro
Source File: Log4jAppender.java
View license
private Properties createProperties() {
    Properties properties = new Properties();
    properties.setProperty(ClientConfig.LOG4J_FORMATTER, formatterClass);
    properties.setProperty(ClientConfig.LOG4J_DATETIMEFORMAT, datetimeFormat);
    properties.setProperty(ClientConfig.LOG4J_ROUTING_KEY, routingKey);
    properties.setProperty(ClientConfig.APP, app);
    properties.setProperty(ClientConfig.COMPRESSION, compression);
    properties.setProperty(ClientConfig.LB_TYPE, loadBalancerType);
    properties.setProperty(ClientConfig.LB_SERVER, loadBalancerServer);
    properties.setProperty(ClientConfig.ASYNC_MEMORYQUEUE_CAPACITY, asyncMemoryQueueCapacity);
    properties.setProperty(ClientConfig.ASYNC_QUEUE_TYPE, asyncQueueType);
    properties.setProperty(ClientConfig.ASYNC_FILEQUEUE_PATH, asyncFileQueuePath);
    properties.setProperty(ClientConfig.CLIENT_TYPE, clientType);
    return properties;
}

34. AgeBasedWorkflowBuilder#getWorkflowProperties()

Project: falcon
Source File: AgeBasedWorkflowBuilder.java
View license
private static Properties getWorkflowProperties(Feed feed, Cluster cluster) throws FalconException {
    final Storage storage = FeedHelper.createStorage(cluster, feed);
    Properties props = new Properties();
    props.setProperty("srcClusterName", "NA");
    props.setProperty("availabilityFlag", "NA");
    props.put("timeZone", feed.getTimezone().getID());
    props.put("frequency", feed.getFrequency().getTimeUnit().name());
    props.put("falconFeedStorageType", storage.getType().name());
    props.put("limit", new AgeBasedDelete().getRetentionLimit(feed, cluster.getName()).toString());
    props.put("falconInputFeeds", feed.getName());
    props.put("falconInPaths", OozieBuilderUtils.IGNORE);
    String feedDataPath = storage.getUriTemplate();
    props.put("feedDataPath", feedDataPath.replaceAll(Storage.DOLLAR_EXPR_START_REGEX, Storage.QUESTION_EXPR_START_REGEX));
    props.put(WorkflowExecutionArgs.OUTPUT_FEED_NAMES.getName(), feed.getName());
    props.put(WorkflowExecutionArgs.OUTPUT_FEED_PATHS.getName(), OozieBuilderUtils.IGNORE);
    return props;
}

35. OozieBuilderUtils#createDefaultConfiguration()

Project: falcon
Source File: OozieBuilderUtils.java
View license
// creates the default configuration which is written in config-default.xml
public static Properties createDefaultConfiguration(Cluster cluster, Entity entity, WorkflowExecutionContext.EntityOperations operation) throws FalconException {
    Properties props = new Properties();
    props.put(WorkflowExecutionArgs.ENTITY_NAME.getName(), entity.getName());
    props.put(WorkflowExecutionArgs.ENTITY_TYPE.getName(), entity.getEntityType().name());
    props.put(WorkflowExecutionArgs.CLUSTER_NAME.getName(), cluster.getName());
    props.put(WorkflowExecutionArgs.DATASOURCE_NAME.getName(), "NA");
    props.put("falconDataOperation", operation.name());
    props.put(WorkflowExecutionArgs.LOG_DIR.getName(), getStoragePath(EntityUtil.getLogPath(cluster, entity)));
    props.put(WorkflowExecutionArgs.WF_ENGINE_URL.getName(), ClusterHelper.getOozieUrl(cluster));
    addLateDataProperties(props, entity);
    addBrokerProperties(cluster, props);
    props.put(MR_QUEUE_NAME, "default");
    props.put(MR_JOB_PRIORITY, "NORMAL");
    //properties provided in entity override the default generated properties
    props.putAll(EntityUtil.getEntityProperties(entity));
    props.putAll(createAppProperties(cluster));
    return props;
}

36. TdlDstu2Config#jpaProperties()

Project: hapi-fhir
Source File: TdlDstu2Config.java
View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.format_sql", "false");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", myFhirLuceneLocation);
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    return extraProperties;
}

37. TdlDstu3Config#jpaProperties()

Project: hapi-fhir
Source File: TdlDstu3Config.java
View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.format_sql", "false");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", myFhirLuceneLocation);
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    return extraProperties;
}

38. TestDstu2Config#jpaProperties()

Project: hapi-fhir
Source File: TestDstu2Config.java
View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.format_sql", "false");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", myFhirLuceneLocation);
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    return extraProperties;
}

39. TestDstu3Config#jpaProperties()

Project: hapi-fhir
Source File: TestDstu3Config.java
View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.format_sql", "false");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", myFhirLuceneLocation);
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    return extraProperties;
}

40. SystemManagerImpl#remapRawGitProperties()

Project: hydra
Source File: SystemManagerImpl.java
View license
private Properties remapRawGitProperties(Properties raw) {
    Properties p = new Properties();
    p.put("commitIdAbbrev", Strings.nullToEmpty(raw.getProperty("git.commit.id.abbrev")));
    p.put("commitUserEmail", Strings.nullToEmpty(raw.getProperty("git.commit.user.email")));
    p.put("commitMessageFull", Strings.nullToEmpty(raw.getProperty("git.commit.message.full")));
    p.put("commitId", Strings.nullToEmpty(raw.getProperty("git.commit.id")));
    p.put("commitUserName", Strings.nullToEmpty(raw.getProperty("git.commit.user.name")));
    p.put("buildUserName", Strings.nullToEmpty(raw.getProperty("git.build.user.name")));
    p.put("commitIdDescribe", Strings.nullToEmpty(raw.getProperty("git.commit.id.describe")));
    p.put("buildUserEmail", Strings.nullToEmpty(raw.getProperty("git.build.user.email")));
    p.put("branch", Strings.nullToEmpty(raw.getProperty("git.branch")));
    p.put("commitTime", Strings.nullToEmpty(raw.getProperty("git.commit.time")));
    p.put("buildTime", Strings.nullToEmpty(raw.getProperty("git.build.time")));
    return p;
}

41. TestAuthorize#createKafkaProducer()

Project: incubator-sentry
Source File: TestAuthorize.java
View license
private KafkaProducer<String, String> createKafkaProducer(String user) {
    Properties props = new Properties();
    props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
    props.put(ProducerConfig.CLIENT_ID_CONFIG, "SentryKafkaProducer");
    props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
    props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
    props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
    props.put(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "JKS");
    props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".keystore.jks").getPath());
    props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, user + "-ks-passwd");
    props.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, user + "-key-passwd");
    props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, KafkaTestServer.class.getResource("/" + user + ".truststore.jks").getPath());
    props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, user + "-ts-passwd");
    return new KafkaProducer<String, String>(props);
}

42. SpringBeansConfigTest#empty()

Project: pinpoint
Source File: SpringBeansConfigTest.java
View license
@Test
public void empty() {
    Properties properties = new Properties();
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 1 + SpringBeansConfig.SPRING_BEANS_NAME_PATTERN_POSTFIX, "Target.*");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 1 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "org.springframework.stereotype.Controller");
    // empty
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 2 + SpringBeansConfig.SPRING_BEANS_NAME_PATTERN_POSTFIX, "");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 2 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "");
    // empty
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 3 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "");
    // empty
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 4 + SpringBeansConfig.SPRING_BEANS_NAME_PATTERN_POSTFIX, "");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 4 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "");
    // empty
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 5 + SpringBeansConfig.SPRING_BEANS_NAME_PATTERN_POSTFIX, "");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 5 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 6 + SpringBeansConfig.SPRING_BEANS_CLASS_PATTERN_POSTFIX, "java.lang.String");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 6 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "org.springframework.stereotype.Service");
    ProfilerConfig config = new DefaultProfilerConfig(properties);
    SpringBeansConfig springBeansConfig = new SpringBeansConfig(config);
    assertEquals(6, springBeansConfig.getTargets().size());
}

43. CommunoteIntegrationTest#createCoreProperties()

View license
/**
     * Create and fill the core properties. Will be triggered by
     * [email protected] #setupApplication(String, String)} if skipApplicationInitializing option is false.
     *
     * @return the prepared properties
     */
protected Properties createCoreProperties() {
    Properties coreProperties = new Properties();
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_DRIVER_CLASS_NAME.getKeyString(), databaseType.getDialectClassName());
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_HOST.getKeyString(), host);
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_NAME.getKeyString(), databaseName);
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_PORT.getKeyString(), port);
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_PROTOCOL.getKeyString(), databaseType.getProtocol());
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_PROTOCOL_SEPARATOR.getKeyString(), databaseType.getDefaultProtocolSeperator());
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_USER_NAME.getKeyString(), username);
    coreProperties.setProperty(CorePropertyDatabase.DATABASE_USER_PASSWORD.getKeyString(), password);
    coreProperties.setProperty(CorePropertyDatabase.HIBERNATE_DIALECT.getKeyString(), databaseType.getDialectClassName());
    coreProperties.setProperty(CoreProperty.INSTALLATION_DONE.getKeyString(), "true");
    return coreProperties;
}

44. OozieOrchestrationWorkflowBuilder#createDefaultConfiguration()

View license
public Properties createDefaultConfiguration(Cluster cluster) throws FalconException {
    Properties props = new Properties();
    props.put(WorkflowExecutionArgs.ENTITY_NAME.getName(), entity.getName());
    props.put(WorkflowExecutionArgs.ENTITY_TYPE.getName(), entity.getEntityType().name());
    props.put(WorkflowExecutionArgs.CLUSTER_NAME.getName(), cluster.getName());
    props.put("falconDataOperation", getOperation().name());
    props.put(WorkflowExecutionArgs.LOG_DIR.getName(), getStoragePath(EntityUtil.getLogPath(cluster, entity)));
    props.put(WorkflowExecutionArgs.WF_ENGINE_URL.getName(), ClusterHelper.getOozieUrl(cluster));
    addLateDataProperties(props);
    addBrokerProperties(cluster, props);
    props.put(MR_QUEUE_NAME, "default");
    props.put(MR_JOB_PRIORITY, "NORMAL");
    //props in entity override the set props.
    props.putAll(EntityUtil.getEntityProperties(entity));
    props.putAll(createAppProperties(cluster));
    return props;
}

45. LogManagerTest#initProps()

Project: j2objc
Source File: LogManagerTest.java
View license
static Properties initProps() throws Exception {
    Properties props = new Properties();
    props.put("handlers", className + "$MockHandler " + className + "$MockHandler");
    props.put("java.util.logging.FileHandler.pattern", "%h/java%u.log");
    props.put("java.util.logging.FileHandler.limit", "50000");
    props.put("java.util.logging.FileHandler.count", "5");
    props.put("java.util.logging.FileHandler.formatter", "java.util.logging.XMLFormatter");
    props.put(".level", "FINE");
    props.put("java.util.logging.ConsoleHandler.level", "OFF");
    props.put("java.util.logging.ConsoleHandler.formatter", "java.util.logging.SimpleFormatter");
    props.put("LogManagerTestFoo.handlers", "java.util.logging.ConsoleHandler");
    props.put("LogManagerTestFoo.level", "WARNING");
    return props;
}

46. GhIssueTest211_249#setUpFor244()

Project: rythmengine
Source File: GhIssueTest211_249.java
View license
private void setUpFor244() {
    Rythm.shutdown();
    Properties prop = System.getProperties();
    prop.put(HOME_TEMPLATE.getKey(), "root/gh244");
    prop.put(FEATURE_NATURAL_TEMPLATE_ENABLED.getKey(), "false");
    prop.put(FEATURE_TYPE_INFERENCE_ENABLED.getKey(), "false");
    prop.put(FEATURE_SMART_ESCAPE_ENABLED.getKey(), "true");
    prop.put(FEATURE_TRANSFORM_ENABLED.getKey(), "true");
    prop.put(CODEGEN_COMPACT_ENABLED.getKey(), "false");
    prop.put(ENGINE_OUTPUT_JAVA_SOURCE_ENABLED.getKey(), "false");
    //prop.put(RythmConfigurationKey.I18N_LOCALE.getKey(), new Locale("en", "AU"));
    prop.put(RythmConfigurationKey.I18N_LOCALE.getKey(), Locale.getDefault());
    prop.put("line.separator", "\n");
    prop.put(DEFAULT_CODE_TYPE_IMPL.getKey(), ICodeType.DefImpl.RAW);
    t = null;
    s = null;
}

47. TestBase#initRythm()

Project: rythmengine
Source File: TestBase.java
View license
@Before
public void initRythm() throws Exception {
    Rythm.shutdown();
    Properties prop = System.getProperties();
    prop.put(HOME_TEMPLATE.getKey(), "root");
    prop.put(FEATURE_NATURAL_TEMPLATE_ENABLED.getKey(), "false");
    prop.put(FEATURE_TYPE_INFERENCE_ENABLED.getKey(), "false");
    prop.put(FEATURE_SMART_ESCAPE_ENABLED.getKey(), "true");
    prop.put(FEATURE_TRANSFORM_ENABLED.getKey(), "true");
    prop.put(CODEGEN_COMPACT_ENABLED.getKey(), "false");
    prop.put(ENGINE_OUTPUT_JAVA_SOURCE_ENABLED.getKey(), "false");
    //prop.put(RythmConfigurationKey.I18N_LOCALE.getKey(), new Locale("en", "AU"));
    prop.put(RythmConfigurationKey.I18N_LOCALE.getKey(), Locale.getDefault());
    prop.put("line.separator", "\n");
    prop.put(DEFAULT_CODE_TYPE_IMPL.getKey(), ICodeType.DefImpl.RAW);
    Class.forName("org.rythmengine.utils.Eval");
    t = null;
    s = null;
}

48. EhcacheMemoryService#getProperties()

Project: sakai
Source File: EhcacheMemoryService.java
View license
@Override
public Properties getProperties() {
    Configuration ec = cacheManager.getConfiguration();
    Properties p = new Properties();
    p.put("name", ec.getName());
    p.put("source", ec.getConfigurationSource().toString());
    p.put("timeoutSeconds", ec.getDefaultTransactionTimeoutInSeconds());
    p.put("maxBytesDisk", ec.getMaxBytesLocalDisk());
    p.put("maxBytesHeap", ec.getMaxBytesLocalHeap());
    p.put("maxDepth", ec.getSizeOfPolicyConfiguration().getMaxDepth());
    p.put("defaultCacheMaxEntries", ec.getDefaultCacheConfiguration().getMaxEntriesLocalHeap());
    p.put("defaultCacheTimeToIdleSecs", ec.getDefaultCacheConfiguration().getTimeToIdleSeconds());
    p.put("defaultCacheTimeToLiveSecs", ec.getDefaultCacheConfiguration().getTimeToLiveSeconds());
    p.put("defaultCacheEternal", ec.getDefaultCacheConfiguration().isEternal());
    return p;
}

49. KafkaServerExternalResource#createBrokerConfig()

View license
public static Properties createBrokerConfig(int nodeId, int port, int zkPort, String dir) {
    Properties props = new Properties();
    props.put("broker.id", Integer.toString(nodeId));
    props.put("brokerId", Integer.toString(nodeId));
    props.put("host.name", "localhost");
    props.put("port", Integer.toString(port));
    props.put("log.dir", dir);
    props.put("log.flush.interval.messages", "1");
    props.put("zookeeper.connect", "localhost:" + zkPort);
    props.put("replica.socket.timeout.ms", "1500");
    props.put("hostName", "localhost");
    props.put("numPartitions", "1");
    return props;
}

50. CachedSchemaRegistryClientTest#createConsumerProps()

View license
private Properties createConsumerProps() {
    Properties props = new Properties();
    props.put("bootstrap.servers", brokerList);
    props.put("group.id", "avroGroup");
    // default value of group.min.session.timeout.ms.
    props.put("session.timeout.ms", "6000");
    props.put("heartbeat.interval.ms", "2000");
    props.put("auto.commit.interval.ms", "1000");
    props.put("auto.offset.reset", "earliest");
    props.put("key.deserializer", org.apache.kafka.common.serialization.StringDeserializer.class);
    props.put("value.deserializer", io.confluent.kafka.serializers.KafkaAvroDeserializer.class);
    props.put(SCHEMA_REGISTRY_URL, restApp.restConnect);
    return props;
}

51. TestSentryRole#setup()

Project: sentry
Source File: TestSentryRole.java
View license
@Before
public void setup() throws Exception {
    dataDir = new File(Files.createTempDir(), "sentry_policy_db");
    Properties prop = new Properties();
    prop.setProperty(ServerConfig.JAVAX_JDO_URL, "jdbc:derby:;databaseName=" + dataDir.getPath() + ";create=true");
    prop.setProperty(ServerConfig.JAVAX_JDO_USER, "Sentry");
    prop.setProperty(ServerConfig.JAVAX_JDO_PASS, "Sentry");
    prop.setProperty(ServerConfig.JAVAX_JDO_DRIVER_NAME, "org.apache.derby.jdbc.EmbeddedDriver");
    prop.setProperty("datanucleus.schema.autoCreateAll", "true");
    prop.setProperty("datanucleus.autoCreateSchema", "true");
    prop.setProperty("datanucleus.fixedDatastore", "false");
    prop.setProperty("datanucleus.NontransactionalRead", "false");
    prop.setProperty("datanucleus.NontransactionalWrite", "false");
    pmf = JDOHelper.getPersistenceManagerFactory(prop);
}

52. TestLog4JAppenderWithLog4JConfig#setup()

View license
@Before
public void setup() throws Exception {
    servers = TestConnectionPool.startServers(1);
    Properties props = new Properties();
    props.setProperty("log4j.logger.com.netflix.suro.input", "WARN,SURO");
    props.setProperty("log4j.appender.stdout.layout.ConversionPattern", "%5p [%t] (%F:%L) - %m%n");
    props.setProperty("log4j.appender.SURO", "com.netflix.suro.input.Log4jAppender");
    props.setProperty("log4j.appender.SURO.app", "ajjainApp");
    props.setProperty("log4j.appender.SURO.routingKey", "ajjainroutingkey");
    props.setProperty("log4j.appender.SURO.loadBalancerType", "static");
    props.setProperty("log4j.appender.SURO.loadBalancerServer", TestConnectionPool.createConnectionString(servers));
    props.setProperty("log4j.appender.SURO.compression", "0");
    props.setProperty("log4j.appender.SURO.clientType", "sync");
    PropertyConfigurator.configure(props);
}

53. CassandraInterpreterTest#setUp()

View license
@BeforeClass
public static void setUp() {
    Properties properties = new Properties();
    final Cluster cluster = session.getCluster();
    properties.setProperty(CASSANDRA_CLUSTER_NAME, cluster.getClusterName());
    properties.setProperty(CASSANDRA_COMPRESSION_PROTOCOL, "NONE");
    properties.setProperty(CASSANDRA_CREDENTIALS_USERNAME, "none");
    properties.setProperty(CASSANDRA_CREDENTIALS_PASSWORD, "none");
    properties.setProperty(CASSANDRA_PROTOCOL_VERSION, "3");
    properties.setProperty(CASSANDRA_LOAD_BALANCING_POLICY, "DEFAULT");
    properties.setProperty(CASSANDRA_RETRY_POLICY, "DEFAULT");
    properties.setProperty(CASSANDRA_RECONNECTION_POLICY, "DEFAULT");
    properties.setProperty(CASSANDRA_SPECULATIVE_EXECUTION_POLICY, "DEFAULT");
    properties.setProperty(CASSANDRA_MAX_SCHEMA_AGREEMENT_WAIT_SECONDS, DEFAULT_MAX_SCHEMA_AGREEMENT_WAIT_SECONDS + "");
    properties.setProperty(CASSANDRA_POOLING_NEW_CONNECTION_THRESHOLD_LOCAL, "100");
    properties.setProperty(CASSANDRA_POOLING_NEW_CONNECTION_THRESHOLD_REMOTE, "100");
    properties.setProperty(CASSANDRA_POOLING_CORE_CONNECTION_PER_HOST_LOCAL, "2");
    properties.setProperty(CASSANDRA_POOLING_CORE_CONNECTION_PER_HOST_REMOTE, "1");
    properties.setProperty(CASSANDRA_POOLING_MAX_CONNECTION_PER_HOST_LOCAL, "8");
    properties.setProperty(CASSANDRA_POOLING_MAX_CONNECTION_PER_HOST_REMOTE, "2");
    properties.setProperty(CASSANDRA_POOLING_MAX_REQUESTS_PER_CONNECTION_LOCAL, "1024");
    properties.setProperty(CASSANDRA_POOLING_MAX_REQUESTS_PER_CONNECTION_REMOTE, "256");
    properties.setProperty(CASSANDRA_POOLING_IDLE_TIMEOUT_SECONDS, "120");
    properties.setProperty(CASSANDRA_POOLING_POOL_TIMEOUT_MILLIS, "5000");
    properties.setProperty(CASSANDRA_POOLING_HEARTBEAT_INTERVAL_SECONDS, "30");
    properties.setProperty(CASSANDRA_QUERY_DEFAULT_CONSISTENCY, "ONE");
    properties.setProperty(CASSANDRA_QUERY_DEFAULT_SERIAL_CONSISTENCY, "SERIAL");
    properties.setProperty(CASSANDRA_QUERY_DEFAULT_FETCH_SIZE, "5000");
    properties.setProperty(CASSANDRA_SOCKET_CONNECTION_TIMEOUT_MILLIS, "5000");
    properties.setProperty(CASSANDRA_SOCKET_READ_TIMEOUT_MILLIS, "12000");
    properties.setProperty(CASSANDRA_SOCKET_TCP_NO_DELAY, "true");
    properties.setProperty(CASSANDRA_HOSTS, from(cluster.getMetadata().getAllHosts()).first().get().getAddress().getHostAddress());
    properties.setProperty(CASSANDRA_PORT, cluster.getConfiguration().getProtocolOptions().getPort() + "");
    interpreter = new CassandraInterpreter(properties);
    interpreter.open();
}

54. MockCluster#initializeServer()

Project: ambry
Source File: MockCluster.java
View license
private void initializeServer(DataNodeId dataNodeId, Properties sslProperties, boolean enableHardDeletes, Time time) throws IOException, InstantiationException, URISyntaxException {
    Properties props = new Properties();
    props.setProperty("host.name", dataNodeId.getHostname());
    props.setProperty("port", Integer.toString(dataNodeId.getPort()));
    props.setProperty("store.data.flush.interval.seconds", "1");
    props.setProperty("store.enable.hard.delete", Boolean.toString(enableHardDeletes));
    props.setProperty("store.deleted.message.retention.days", "1");
    props.setProperty("replication.token.flush.interval.seconds", "5");
    props.setProperty("replication.wait.time.between.replicas.ms", "50");
    props.setProperty("replication.validate.message.stream", "true");
    props.putAll(sslProperties);
    VerifiableProperties propverify = new VerifiableProperties(props);
    AmbryServer server = new AmbryServer(propverify, clusterMap, notificationSystem, time);
    serverList.add(server);
}

55. GateScriptTest#storeTo_parameterNames()

Project: asakusafw
Source File: GateScriptTest.java
View license
/**
     * stores driver scripts w/ parameter names.
     */
@Test
public void storeTo_parameterNames() {
    Properties p = new Properties();
    p.setProperty(k("test", KEY_DATA_CLASS), String.class.getName());
    p.setProperty(k("test", KEY_PROCESS_TYPE), "plain");
    p.setProperty(k("test", PREFIX_SOURCE), "ts");
    p.setProperty(k("test", PREFIX_SOURCE, "aaa"), "bbb");
    p.setProperty(k("test", PREFIX_SOURCE, GateScript.KEY_PARAMETER_NAMES), "a$b$c");
    p.setProperty(k("test", PREFIX_DRAIN), "td");
    p.setProperty(k("test", PREFIX_DRAIN, "bbb"), "ccc");
    p.setProperty(k("test", PREFIX_DRAIN, GateScript.KEY_PARAMETER_NAMES), "d$e$f");
    GateScript script = GateScript.loadFrom("testing", p, getClass().getClassLoader());
    Properties target = new Properties();
    script.storeTo(target);
    assertThat(target, is(p));
}

56. PropertiesUtilTest#createPrefixMap()

Project: asakusafw
Source File: PropertiesUtilTest.java
View license
/**
     * Test method for [email protected] PropertiesUtil#createPrefixMap(java.util.Map, java.lang.String)}.
     */
@Test
public void createPrefixMap() {
    Properties properties = new Properties();
    properties.put("abcde", "abcde");
    properties.put("abc0", "abc0");
    properties.put("abc", "abc");
    properties.put("ab", "ab");
    properties.put("abbde", "abbde");
    properties.put("abd", "abd");
    properties.put("bcdef", "bcdef");
    char[] array = "abc[]".toCharArray();
    properties.put(array, "abc[]");
    properties.put("abc[]", array);
    Map<String, String> answer = new HashMap<>();
    answer.put("de", "abcde");
    answer.put("0", "abc0");
    answer.put("", "abc");
    assertThat(PropertiesUtil.createPrefixMap(properties, "abc"), is(answer));
}

57. PropertiesUtilTest#createPrefixMap()

Project: asakusafw
Source File: PropertiesUtilTest.java
View license
/**
     * Test method for [email protected] PropertiesUtil#createPrefixMap(Map, String)}.
     */
@Test
public void createPrefixMap() {
    Properties properties = new Properties();
    properties.put("abcde", "abcde");
    properties.put("abc0", "abc0");
    properties.put("abc", "abc");
    properties.put("ab", "ab");
    properties.put("abbde", "abbde");
    properties.put("abd", "abd");
    properties.put("bcdef", "bcdef");
    char[] array = "abc[]".toCharArray();
    properties.put(array, "abc[]");
    properties.put("abc[]", array);
    Map<String, String> answer = new HashMap<>();
    answer.put("de", "abcde");
    answer.put("0", "abc0");
    answer.put("", "abc");
    assertThat(PropertiesUtil.createPrefixMap(properties, "abc"), is(answer));
}

58. CoreSamlConfiguration#velocityEngineFactoryBean()

Project: cas
Source File: CoreSamlConfiguration.java
View license
/**
     * Velocity engine velocity engine factory bean.
     *
     * @return the velocity engine factory bean
     */
@Bean(name = "shibboleth.VelocityEngine")
public VelocityEngineFactoryBean velocityEngineFactoryBean() {
    final VelocityEngineFactoryBean bean = new VelocityEngineFactoryBean();
    final Properties properties = new Properties();
    properties.put("runtime.log.logsystem.class", SLF4JLogChute.class.getName());
    properties.put("input.encoding", "UTF-8");
    properties.put("output.encoding", "UTF-8");
    properties.put("resource.loader", "file, classpath, string");
    properties.put("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
    properties.put("string.resource.loader.class", StringResourceLoader.class.getName());
    properties.put("file.resource.loader.class", FileResourceLoader.class.getName());
    properties.put("file.resource.loader.path", FileUtils.getTempDirectory().getAbsolutePath());
    properties.put("file.resource.loader.cache", false);
    bean.setOverrideLogging(false);
    bean.setVelocityProperties(properties);
    return bean;
}

59. TestMultitenantRelay#setUp()

Project: databus
Source File: TestMultitenantRelay.java
View license
@BeforeClass
public void setUp() throws InvalidConfigException {
    Properties clientProps = new Properties();
    clientProps.setProperty("client.runtime.relay(1).name", "relay");
    clientProps.setProperty("client.runtime.relay(1).port", "10001");
    clientProps.setProperty("client.runtime.relay(1).sources", "source1");
    clientProps.setProperty("client.runtime.relay(2).name", "relay");
    clientProps.setProperty("client.runtime.relay(2).port", "10001");
    clientProps.setProperty("client.runtime.relay(2).sources", "source2");
    clientProps.setProperty("client.runtime.relay(3).name", "relay2");
    clientProps.setProperty("client.runtime.relay(3).port", "10002");
    clientProps.setProperty("client.runtime.relay(3).sources", "source3");
    clientConfBuilder = new DatabusHttpClientImpl.Config();
    ConfigLoader<DatabusHttpClientImpl.StaticConfig> configLoader = new ConfigLoader<DatabusHttpClientImpl.StaticConfig>("client.", clientConfBuilder);
    configLoader.loadConfig(clientProps);
}

60. DefaultDockerClientConfigTest#systemProperties()

View license
@Test
public void systemProperties() throws Exception {
    // given system properties based on the example
    Properties systemProperties = new Properties();
    systemProperties.put(DefaultDockerClientConfig.DOCKER_HOST, "tcp://foo");
    systemProperties.put(DefaultDockerClientConfig.API_VERSION, "apiVersion");
    systemProperties.put(DefaultDockerClientConfig.REGISTRY_USERNAME, "registryUsername");
    systemProperties.put(DefaultDockerClientConfig.REGISTRY_PASSWORD, "registryPassword");
    systemProperties.put(DefaultDockerClientConfig.REGISTRY_EMAIL, "registryEmail");
    systemProperties.put(DefaultDockerClientConfig.REGISTRY_URL, "registryUrl");
    systemProperties.put(DefaultDockerClientConfig.DOCKER_CONFIG, "dockerConfig");
    systemProperties.put(DefaultDockerClientConfig.DOCKER_CERT_PATH, dockerCertPath());
    systemProperties.put(DefaultDockerClientConfig.DOCKER_TLS_VERIFY, "1");
    // when you build new config
    DefaultDockerClientConfig config = buildConfig(Collections.<String, String>emptyMap(), systemProperties);
    // then it is the same as the example
    assertEquals(config, EXAMPLE_CONFIG);
}

61. NativeOozieProcessWorkflowBuilder#build()

View license
@Override
public java.util.Properties build(Cluster cluster, Path buildPath, Properties suppliedProps) throws FalconException {
    Properties elProps = new Properties();
    DateTimeFormatter fmt = DateTimeFormat.forPattern(INSTANCE_FORMAT);
    elProps.put(WorkflowExecutionArgs.NOMINAL_TIME.getName(), fmt.print(getNominalTime()));
    elProps.put(WorkflowExecutionArgs.TIMESTAMP.getName(), fmt.print(getNominalTime()));
    elProps.put(WorkflowExecutionArgs.USER_JMS_NOTIFICATION_ENABLED.getName(), "true");
    //check true or false
    elProps.put(WorkflowExecutionArgs.SYSTEM_JMS_NOTIFICATION_ENABLED.getName(), "false");
    DateUtil.setTimeZone(entity.getTimezone().getID());
    ExpressionHelper.setReferenceDate(new Date(getNominalTime().getMillis()));
    elProps.putAll(getInputProps(cluster));
    elProps.putAll(getOutputProps());
    elProps.putAll(evalProperties());
    Properties buildProps = build(cluster, buildPath);
    buildProps.putAll(elProps);
    copyPropsWithoutOverride(buildProps, suppliedProps);
    return buildProps;
}

62. FlatfileProvider#saveAreaZone()

View license
public static void saveAreaZone(File path, AreaZone areaZone) {
    path.mkdirs();
    Properties p = new Properties();
    p.setProperty("id", Integer.toString(areaZone.getId()));
    p.setProperty("name", areaZone.getName());
    p.setProperty("x1", Integer.toString(areaZone.getArea().getLowPoint().getX()));
    p.setProperty("y1", Integer.toString(areaZone.getArea().getLowPoint().getY()));
    p.setProperty("z1", Integer.toString(areaZone.getArea().getLowPoint().getZ()));
    p.setProperty("x2", Integer.toString(areaZone.getArea().getHighPoint().getX()));
    p.setProperty("y2", Integer.toString(areaZone.getArea().getHighPoint().getY()));
    p.setProperty("z2", Integer.toString(areaZone.getArea().getHighPoint().getZ()));
    p.setProperty("shape", areaZone.getShape().toString());
    try (OutputStream os = new BufferedOutputStream(new FileOutputStream(new File(path, "area.xml")))) {
        p.storeToXML(os, "Data of area " + areaZone.getName());
    } catch (IOException e) {
        e.printStackTrace();
    }
}

63. InternalVertexRunner#configLocalZooKeeper()

Project: giraph
Source File: InternalVertexRunner.java
View license
/**
   * Configuration options for running local ZK.
   *
   * @param zkDir directory for ZK to hold files in.
   * @return Properties configured for local ZK.
   */
private static Properties configLocalZooKeeper(File zkDir) {
    Properties zkProperties = new Properties();
    zkProperties.setProperty("tickTime", "2000");
    zkProperties.setProperty("dataDir", zkDir.getAbsolutePath());
    zkProperties.setProperty("clientPort", String.valueOf(LOCAL_ZOOKEEPER_PORT));
    zkProperties.setProperty("maxClientCnxns", "10000");
    zkProperties.setProperty("minSessionTimeout", "10000");
    zkProperties.setProperty("maxSessionTimeout", "100000");
    zkProperties.setProperty("initLimit", "10");
    zkProperties.setProperty("syncLimit", "5");
    zkProperties.setProperty("snapCount", "50000");
    return zkProperties;
}

64. SASL_SimpleAuthorizingCallbackTest#initialize()

View license
@BeforeClass
public void initialize() throws Exception {
    Properties credentials = new Properties();
    credentials.put("jack", "brokehiscrown");
    credentials.put("jill", "cametumblingafter");
    credentials.put("jane", "whatsyourname");
    credentialsFile = File.createTempFile("sasl_credentials", ".properties");
    credentials.store(new FileOutputStream(credentialsFile), null);
    Properties roles = new Properties();
    roles.put("jack", "mycluster");
    roles.put("jill", "mycluster");
    roles.put("jane", "othercluster");
    rolesFile = File.createTempFile("sasl_roles", ".properties");
    roles.store(new FileOutputStream(rolesFile), null);
}

65. CoreSamlConfiguration#velocityEngineFactoryBean()

Project: passport
Source File: CoreSamlConfiguration.java
View license
/**
     * Velocity engine velocity engine factory bean.
     *
     * @return the velocity engine factory bean
     */
@Bean(name = "shibboleth.VelocityEngine")
public VelocityEngineFactoryBean velocityEngineFactoryBean() {
    final VelocityEngineFactoryBean bean = new VelocityEngineFactoryBean();
    final Properties properties = new Properties();
    properties.put("runtime.log.logsystem.class", SLF4JLogChute.class.getName());
    properties.put("input.encoding", "UTF-8");
    properties.put("output.encoding", "UTF-8");
    properties.put("resource.loader", "file, classpath, string");
    properties.put("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
    properties.put("string.resource.loader.class", StringResourceLoader.class.getName());
    properties.put("file.resource.loader.class", FileResourceLoader.class.getName());
    properties.put("file.resource.loader.path", FileUtils.getTempDirectory().getAbsolutePath());
    properties.put("file.resource.loader.cache", false);
    bean.setOverrideLogging(false);
    bean.setVelocityProperties(properties);
    return bean;
}

66. GateScriptTest#storeTo_conflict()

Project: asakusafw
Source File: GateScriptTest.java
View license
/**
     * Attempts to dump properties but conflict the target properties.
     */
@Test(expected = IllegalArgumentException.class)
public void storeTo_conflict() {
    Properties p = new Properties();
    p.setProperty(k("test", KEY_DATA_CLASS), String.class.getName());
    p.setProperty(k("test", KEY_PROCESS_TYPE), "plain");
    p.setProperty(k("test", PREFIX_SOURCE), "ts");
    p.setProperty(k("test", PREFIX_SOURCE, "aaa"), "bbb");
    p.setProperty(k("test", PREFIX_DRAIN), "td");
    p.setProperty(k("test", PREFIX_DRAIN, "bbb"), "ccc");
    GateScript script = GateScript.loadFrom("testing", p, getClass().getClassLoader());
    Properties target = new Properties();
    target.setProperty(k("test", KEY_DATA_CLASS), String.class.getName());
    script.storeTo(target);
}

67. GateScriptTest#storeTo_orthogonal()

Project: asakusafw
Source File: GateScriptTest.java
View license
/**
     * Target properties are not empty but not conflict for the any processes.
     */
@Test
public void storeTo_orthogonal() {
    Properties p = new Properties();
    p.setProperty(k("test", KEY_DATA_CLASS), String.class.getName());
    p.setProperty(k("test", KEY_PROCESS_TYPE), "plain");
    p.setProperty(k("test", PREFIX_SOURCE), "ts");
    p.setProperty(k("test", PREFIX_SOURCE, "aaa"), "bbb");
    p.setProperty(k("test", PREFIX_DRAIN), "td");
    p.setProperty(k("test", PREFIX_DRAIN, "bbb"), "ccc");
    GateScript script = GateScript.loadFrom("testing", p, getClass().getClassLoader());
    Properties target = new Properties();
    target.setProperty(k("orthogonal", KEY_DATA_CLASS), String.class.getName());
    script.storeTo(target);
}

68. PropertiesUtilTest#getChildKeys()

Project: asakusafw
Source File: PropertiesUtilTest.java
View license
/**
     * Test method for [email protected] PropertiesUtil#getChildKeys(Map, String, String)}
     *
     * @throws IllegalArgumentException if some parameters were [email protected] null}
     */
@Test
public void getChildKeys() {
    Properties properties = new Properties();
    properties.put("aaa", "");
    properties.put("aaa.bbb", "");
    properties.put("aaa.ccc.1", "");
    properties.put("aaa.ccc.2", "");
    properties.put("aaa.ddd", "");
    properties.put("aaa.ddd.1", "");
    properties.put("aab.1", "");
    properties.put("aa9.1", "");
    Set<String> keys = PropertiesUtil.getChildKeys(properties, "aaa.", ".");
    assertThat(keys.size(), is(3));
    assertThat(keys, hasItem("aaa.bbb"));
    assertThat(keys, hasItem("aaa.ccc"));
    assertThat(keys, hasItem("aaa.ddd"));
}

69. MacroTest#testNested()

Project: bnd
Source File: MacroTest.java
View license
/**
	 * Check if variables that contain variables, ad nauseum, really wrk
	 */
public static void testNested() {
    Builder builder = new Builder();
    Properties p = new Properties();
    p.setProperty("a", ".");
    p.setProperty("b", "${a}");
    p.setProperty("c", "${b}");
    p.setProperty("d", "${tstamp;${format};UTC;${aug152008}}");
    p.setProperty("format", "yyyy");
    p.setProperty("aug152008", "1218810097322");
    p.setProperty("f", "${d}");
    p.setProperty("aug152008", "1218810097322");
    builder.setProperties(p);
    assertEquals(".", builder.getProperty("c"));
    assertEquals("2008", builder.getProperty("d"));
    assertEquals(builder.getProperty("f"), builder.getProperty("d"));
}

70. KafkaConsumer09IT#produce()

View license
private void produce(String topic, String bootstrapServers, String message) {
    Properties props = new Properties();
    props.put("bootstrap.servers", bootstrapServers);
    props.put("acks", "all");
    props.put("retries", 0);
    props.put("batch.size", 16384);
    props.put("linger.ms", 1);
    props.put("buffer.memory", 33554432);
    props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
    props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
    KafkaProducer<String, String> producer = new KafkaProducer<>(props);
    for (int i = 0; i < 10; i++) producer.send(new ProducerRecord<>(topic, Integer.toString(0), message + i));
    producer.close();
}

71. StressMultiTest#embeddedSuite()

Project: derby
Source File: StressMultiTest.java
View license
/**
     * Get at testsuite that runs only the embedded suite with 
     * the given number of threads for the given number of minutes. 
     * 
     * @param threads
     * @param minutes
     */
public static Test embeddedSuite(int threads, int minutes) {
    THREADS = threads;
    MINUTES = minutes;
    Properties dbprops = new Properties();
    dbprops.put("derby.locks.deadlockTimeout", "2");
    dbprops.put("derby.locks.waitTimeout", "3");
    dbprops.put("derby.language.logStatementText", "true");
    dbprops.put("derby.storage.keepTransactionLog", "true");
    Properties sysprops = new Properties();
    sysprops.put("derby.storage.keepTransactionLog", "true");
    sysprops.put("derby.language.logStatementText", "true");
    sysprops.put("derby.infolog.append", "true");
    Test embedded = new BaseTestSuite(StressMultiTest.class);
    embedded = new SystemPropertyTestSetup(embedded, sysprops, true);
    embedded = new DatabasePropertyTestSetup(embedded, dbprops);
    embedded = TestConfiguration.singleUseDatabaseDecorator(newCleanDatabase(embedded));
    return embedded;
}

72. AbstractCascadingLocalJsonSaveTest#testUpdateOnlyParamScript()

View license
@Test
public void testUpdateOnlyParamScript() throws Exception {
    Properties properties = new TestSettings().getProperties();
    properties.put(ConfigurationOptions.ES_WRITE_OPERATION, "update");
    properties.put(ConfigurationOptions.ES_MAPPING_ID, "number");
    properties.put(ConfigurationOptions.ES_INDEX_AUTO_CREATE, "yes");
    properties.put(ConfigurationOptions.ES_UPDATE_RETRY_ON_CONFLICT, "3");
    properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT, "counter = param1; anothercounter = param2");
    properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT_LANG, "groovy");
    properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT_PARAMS, " param1:<1>,   param2:number ");
    properties.put(ConfigurationOptions.ES_INPUT_JSON, "yes");
    Tap in = sourceTap();
    // use an existing id to allow the update to succeed
    Tap out = new EsTap("json-cascading-local/createwithid", new Fields("line"));
    Pipe pipe = new Pipe("copy");
    build(properties, in, out, pipe);
}

73. SessionFactoryProvider#getHibernateProperties()

View license
private static Properties getHibernateProperties() {
    Properties prop = new Properties();
    prop.put("hibernate.hbm2ddl.auto", "create-drop");
    prop.put("hibernate.format_sql", "true");
    prop.put("hibernate.connection.autocommit", "false");
    prop.put("hibernate.connection.release_mode", "after_transaction");
    prop.put("hibernate.jdbc.batch_size", "1000");
    prop.put("hibernate.order_inserts", "true");
    prop.put("hibernate.order_updates", "true");
    prop.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    return prop;
}

74. AbstractInMemoryBlockStoreTest#getHibernateProperties()

View license
private Properties getHibernateProperties() {
    Properties prop = new Properties();
    prop.put("hibernate.hbm2ddl.auto", "create-drop");
    prop.put("hibernate.format_sql", "true");
    prop.put("hibernate.connection.autocommit", "false");
    prop.put("hibernate.connection.release_mode", "after_transaction");
    prop.put("hibernate.jdbc.batch_size", "1000");
    prop.put("hibernate.order_inserts", "true");
    prop.put("hibernate.order_updates", "true");
    prop.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    return prop;
}

75. TestDstu3Config#jpaProperties()

Project: hapi-fhir
Source File: TestDstu3Config.java
View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.format_sql", "false");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.dialect", "org.hibernate.dialect.DerbyTenSevenDialect");
    extraProperties.put("hibernate.search.default.directory_provider", "filesystem");
    extraProperties.put("hibernate.search.default.indexBase", "target/lucene_index_dstu3");
    extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
    extraProperties.put("hibernate.search.autoregister_listeners", "true");
    return extraProperties;
}

76. TestDstu1Config#jpaProperties()

Project: hapi-fhir
Source File: TestDstu1Config.java
View license
private Properties jpaProperties() {
    Properties extraProperties = new Properties();
    extraProperties.put("hibernate.format_sql", "true");
    extraProperties.put("hibernate.show_sql", "false");
    extraProperties.put("hibernate.hbm2ddl.auto", "update");
    extraProperties.put("hibernate.jdbc.batch_size", "20");
    extraProperties.put("hibernate.cache.use_query_cache", "false");
    extraProperties.put("hibernate.cache.use_second_level_cache", "false");
    extraProperties.put("hibernate.cache.use_structured_entries", "false");
    extraProperties.put("hibernate.cache.use_minimal_puts", "false");
    return extraProperties;
}

77. TestKafkaBroker#getKafkaConfig()

Project: ignite
Source File: TestKafkaBroker.java
View license
/**
     * Obtains Kafka config.
     *
     * @return Kafka config.
     * @throws IOException If failed.
     */
private Properties getKafkaConfig() throws IOException {
    Properties props = new Properties();
    props.put("broker.id", "0");
    props.put("zookeeper.connect", zkServer.getConnectString());
    props.put("host.name", BROKER_HOST);
    props.put("port", BROKER_PORT);
    props.put("offsets.topic.replication.factor", "1");
    props.put("log.dir", createTmpDir("_cfg").getAbsolutePath());
    props.put("log.flush.interval.messages", "1");
    props.put("log.flush.interval.ms", "10");
    return props;
}

78. TestSentryRole#setup()

View license
@Before
public void setup() throws Exception {
    dataDir = new File(Files.createTempDir(), "sentry_policy_db");
    Properties prop = new Properties();
    prop.setProperty(ServerConfig.JAVAX_JDO_URL, "jdbc:derby:;databaseName=" + dataDir.getPath() + ";create=true");
    prop.setProperty(ServerConfig.JAVAX_JDO_USER, "Sentry");
    prop.setProperty(ServerConfig.JAVAX_JDO_PASS, "Sentry");
    prop.setProperty(ServerConfig.JAVAX_JDO_DRIVER_NAME, "org.apache.derby.jdbc.EmbeddedDriver");
    prop.setProperty("datanucleus.autoCreateSchema", "true");
    prop.setProperty("datanucleus.fixedDatastore", "false");
    prop.setProperty("datanucleus.NontransactionalRead", "false");
    prop.setProperty("datanucleus.NontransactionalWrite", "false");
    pmf = JDOHelper.getPersistenceManagerFactory(prop);
}

79. KafkaLogAppenderTest#doAppendTest()

Project: kaa
Source File: KafkaLogAppenderTest.java
View license
@Test
@Ignore
public void doAppendTest() throws IOException, InterruptedException {
    DeliveryCallback callback = new DeliveryCallback();
    logAppender.doAppend(generateLogEventPack(20), callback);
    Thread.sleep(3000);
    Properties props = new Properties();
    props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
    props.put(ConsumerConfig.GROUP_ID_CONFIG, "test");
    props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
    props.put("auto.commit.interval.ms", "1000");
    props.put("session.timeout.ms", "30000");
    props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
    props.put("value.deserializer", "org.apache.kafka.common.serialization.ByteArrayDeserializer");
    props.put(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY, "range");
    KafkaConsumer<String, byte[]> consumer = new KafkaConsumer<String, byte[]>(props);
    consumer.subscribe(TOPIC_NAME);
    consumer.poll(100);
    consumer.close();
    Assert.assertEquals(20, callback.getSuccessCount());
}

80. JavaSdkGenerator#generateClientProperties()

Project: kaa
Source File: JavaSdkGenerator.java
View license
/**
     * Generate client properties.
     *
     * @param clientPropertiesStream          the client properties stream
     * @param bootstrapNodes                  the bootstrap nodes
     * @param configurationProtocolSchemaBody the configuration protocol schema body
     * @param defaultConfigurationData        the default configuration data
     * @return the byte[]
     * @throws IOException Signals that an I/O exception has occurred.
     */
private byte[] generateClientProperties(InputStream clientPropertiesStream, List<BootstrapNodeInfo> bootstrapNodes, String sdkToken, String configurationProtocolSchemaBody, byte[] defaultConfigurationData) throws IOException {
    Properties clientProperties = new Properties();
    clientProperties.load(clientPropertiesStream);
    LOG.debug("[sdk generateClientProperties] bootstrapNodes.size(): {}", bootstrapNodes.size());
    clientProperties.put(BUILD_VERSION, Version.PROJECT_VERSION);
    clientProperties.put(BUILD_COMMIT_HASH, Version.COMMIT_HASH);
    clientProperties.put(BOOTSTRAP_SERVERS_PROPERTY, CommonSdkUtil.bootstrapNodesToString(bootstrapNodes));
    clientProperties.put(SDK_TOKEN_PROPERTY, sdkToken);
    clientProperties.put(CONFIG_SCHEMA_DEFAULT_PROPERTY, configurationProtocolSchemaBody);
    clientProperties.put(CONFIG_DATA_DEFAULT_PROPERTY, Base64.encodeBase64String(defaultConfigurationData));
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    clientProperties.store(baos, "");
    return baos.toByteArray();
}

81. KafkaOutputConnector#connect()

View license
/**
   * Connect.
   *
   * @param configParameters is the set of configuration parameters, which in
   * this case describe the target appliance, basic auth configuration, etc.
   * (This formerly came out of the ini file.)
   */
@Override
public void connect(ConfigParams configParameters) {
    super.connect(configParameters);
    Properties props = new Properties();
    String IP = params.getParameter(KafkaConfig.IP);
    String PORT = params.getParameter(KafkaConfig.PORT);
    //System.out.println("Kafka IP: " + IP);
    //System.out.println("Kafka Port: " + PORT);
    props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, IP + ":" + PORT);
    props.put(ProducerConfig.RETRIES_CONFIG, "3");
    props.put(ProducerConfig.ACKS_CONFIG, "all");
    props.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "none");
    props.put(ProducerConfig.BATCH_SIZE_CONFIG, 200);
    props.put(ProducerConfig.BLOCK_ON_BUFFER_FULL_CONFIG, true);
    props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
    props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer");
    producer = new KafkaProducer(props);
}

82. TestCmsScheduler#initOpenCmsScheduler()

Project: opencms-core
Source File: TestCmsScheduler.java
View license
/**
     * Initializes a Quartz scheduler.<p>
     *
     * @return the initialized scheduler
     * @throws Exception in case something goes wrong
     */
private Scheduler initOpenCmsScheduler() throws Exception {
    Properties properties = new Properties();
    properties.put("org.quartz.scheduler.instanceName", "OpenCmsScheduler");
    properties.put("org.quartz.scheduler.threadName", "OpenCms: Scheduler");
    properties.put("org.quartz.scheduler.rmi.export", CmsStringUtil.FALSE);
    properties.put("org.quartz.scheduler.rmi.proxy", CmsStringUtil.FALSE);
    properties.put("org.quartz.scheduler.xaTransacted", CmsStringUtil.FALSE);
    properties.put("org.quartz.threadPool.class", "org.opencms.scheduler.CmsSchedulerThreadPool");
    properties.put("org.quartz.jobStore.misfireThreshold", "60000");
    properties.put("org.quartz.jobStore.class", "org.quartz.simpl.RAMJobStore");
    SchedulerFactory schedulerFactory = new StdSchedulerFactory(properties);
    Scheduler scheduler = schedulerFactory.getScheduler();
    scheduler.getMetaData();
    scheduler.start();
    // also make sure CmsUUID is initialized
    CmsUUID.init(CmsUUID.getDummyEthernetAddress());
    return scheduler;
}

83. StrSubstitutorTest#shouldReplaceVariablesWithBackSlashesAndShouldWorkWithRecursion()

Project: owner
Source File: StrSubstitutorTest.java
View license
@Test
public void shouldReplaceVariablesWithBackSlashesAndShouldWorkWithRecursion() {
    Properties values = new Properties();
    values.setProperty("color", "bro\\wn");
    values.setProperty("animal", "qui\\ck\\${color}\\fo\\x");
    values.setProperty("target.attribute", "la\\zy");
    values.setProperty("target.animal", "do\\g");
    values.setProperty("target", "${target.attribute}\\${target.animal}");
    values.setProperty("template", "The ${animal} jum\\ped over the ${target}.");
    values.setProperty("wrapper", "\\foo\\${template}\\bar\\");
    values.setProperty("wrapper2", "\\baz\\${wrapper}\\qux\\");
    StrSubstitutor sub = new StrSubstitutor(values);
    String resolvedString = sub.replace("${wrapper2}");
    assertEquals("\\baz\\\\foo\\The qui\\ck\\bro\\wn\\fo\\x jum\\ped over the la\\zy\\do\\g.\\bar\\\\qux\\", resolvedString);
}

84. SpringBeansConfigTest#backwardCompatibility()

Project: pinpoint
Source File: SpringBeansConfigTest.java
View license
@Test
public void backwardCompatibility() {
    Properties properties = new Properties();
    properties.put(SpringBeansConfig.SPRING_BEANS_NAME_PATTERN, "");
    properties.put(SpringBeansConfig.SPRING_BEANS_CLASS_PATTERN, "com.navercorp.*");
    properties.put(SpringBeansConfig.SPRING_BEANS_ANNOTATION, "org.springframework.stereotype.Controller, org.springframework.stereotype.Servicem, org.springframework.stereotype.Repository");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 1 + SpringBeansConfig.SPRING_BEANS_NAME_PATTERN_POSTFIX, "Target.*");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 1 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "org.springframework.stereotype.Controller");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 2 + SpringBeansConfig.SPRING_BEANS_CLASS_PATTERN_POSTFIX, "java.lang.String");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 2 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "org.springframework.stereotype.Service");
    properties.put(SpringBeansConfig.SPRING_BEANS_PREFIX + 3 + SpringBeansConfig.SPRING_BEANS_ANNOTATION_POSTFIX, "org.springframework.stereotype.Repository");
    ProfilerConfig config = new DefaultProfilerConfig(properties);
    SpringBeansConfig springBeansConfig = new SpringBeansConfig(config);
    // backward compatiblity.
    assertEquals(5, springBeansConfig.getTargets().size());
}

85. TestServlet#dumpRequestAsProperties()

Project: sling
Source File: TestServlet.java
View license
protected void dumpRequestAsProperties(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {
    final Properties props = new Properties();
    response.setContentType("text/plain");
    props.put("servlet.class.name", getClass().getName());
    final Resource r = request.getResource();
    props.put("sling.resource.path", r == null ? "" : r.getPath());
    props.put("sling.resource.type", r == null ? "" : r.getResourceType());
    props.put("http.request.method", request.getMethod());
    props.put("http.request.pathInfo", request.getPathInfo());
    props.put("http.request.requestURI", request.getRequestURI());
    props.put("http.request.requestURL", request.getRequestURL().toString());
    setCustomProperties(props);
    props.store(response.getOutputStream(), "Data created by " + getClass().getName() + " at " + new Date());
    response.getOutputStream().flush();
}

86. MavenUtils#archetypeProperties()

Project: syncope
Source File: MavenUtils.java
View license
private Properties archetypeProperties(final String archetypeVersion, final String groupId, final String artifactId, final String secretKey, final String anonymousKey) {
    final Properties properties = new Properties();
    properties.setProperty("archetypeGroupId", "org.apache.syncope");
    properties.setProperty("archetypeArtifactId", "syncope-archetype");
    if (archetypeVersion.contains("SNAPSHOT")) {
        properties.setProperty("archetypeRepository", "http://repository.apache.org/content/repositories/snapshots");
    } else {
        properties.setProperty("archetypeRepository", "http://repo1.maven.org/maven2");
    }
    properties.setProperty("archetypeVersion", archetypeVersion);
    properties.setProperty("groupId", groupId);
    properties.setProperty("artifactId", artifactId);
    properties.setProperty("secretKey", secretKey);
    properties.setProperty("anonymousKey", anonymousKey);
    properties.setProperty("version", "1.0-SNAPSHOT");
    return properties;
}

87. OSDataProvider#getData()

View license
@Override
protected Object getData(final Locale locale) {
    final Properties properties = new Properties();
    //$NON-NLS-1$ //$NON-NLS-2$
    properties.setProperty(Messages.getString("OSDataProvider.JavaOSName", locale), System.getProperty("os.name"));
    //$NON-NLS-1$ //$NON-NLS-2$
    properties.setProperty(Messages.getString("OSDataProvider.JavaOSArch", locale), System.getProperty("os.arch"));
    properties.setProperty(//$NON-NLS-1$
    Messages.getString("OSDataProvider.JavaOSVersion", locale), //$NON-NLS-1$
    System.getProperty("os.version"));
    properties.setProperty(//$NON-NLS-1$
    Messages.getString("OSDataProvider.JavaAvailProcessors", locale), String.valueOf(Runtime.getRuntime().availableProcessors()));
    //$NON-NLS-1$
    properties.setProperty(Messages.getString("OSDataProvider.PlatformWS", locale), Platform.getWS());
    //$NON-NLS-1$
    properties.setProperty(Messages.getString("OSDataProvider.PlatformOS", locale), Platform.getOS());
    //$NON-NLS-1$
    properties.setProperty(Messages.getString("OSDataProvider.PlatformArch", locale), Platform.getOSArch());
    return properties;
}

88. LensInterpreterTest#test()

Project: zeppelin
Source File: LensInterpreterTest.java
View license
@Test
public void test() {
    Properties prop = new Properties();
    prop.setProperty(LENS_SERVER_URL, "http://127.0.0.1:9999/lensapi");
    prop.setProperty(LENS_CLIENT_DBNAME, "default");
    prop.setProperty(LENS_PERSIST_RESULTSET, "false");
    prop.setProperty(LENS_SESSION_CLUSTER_USER, "default");
    prop.setProperty(ZEPPELIN_MAX_ROWS, "1000");
    prop.setProperty(ZEPPELIN_LENS_RUN_CONCURRENT_SESSION, "true");
    prop.setProperty(ZEPPELIN_LENS_CONCURRENT_SESSIONS, "10");
    LensInterpreter t = new MockLensInterpreter(prop);
    t.open();
    //simple help test
    InterpreterResult result = t.interpret("help", null);
    assertEquals(result.type(), InterpreterResult.Type.TEXT);
    //assertEquals("unable to find 'query execute' in help message", 
    //  result.message().contains("query execute"), result.message());
    t.close();
}

89. AbstractTest#setupEmbeddedKafka()

Project: Argus
Source File: AbstractTest.java
View license
private void setupEmbeddedKafka() {
    Properties properties = new Properties();
    properties.put("zookeeper.connect", zkTestServer.getConnectString());
    properties.put("host.name", "localhost");
    properties.put("port", "9093");
    properties.put("broker.id", "0");
    properties.put("num.partitions", "2");
    properties.put("log.flush.interval.ms", "10");
    properties.put("log.dir", "/tmp/kafka-logs/" + createRandomName());
    KafkaConfig config = new KafkaConfig(properties);
    kafkaServer = new KafkaServerStartable(config);
    kafkaServer.startup();
}

90. GateScriptTest#storeTo()

Project: asakusafw
Source File: GateScriptTest.java
View license
/**
     * Test method for [email protected] GateScript#storeTo(java.util.Properties)}.
     */
@Test
public void storeTo() {
    Properties p = new Properties();
    p.setProperty(k("test", KEY_DATA_CLASS), String.class.getName());
    p.setProperty(k("test", KEY_PROCESS_TYPE), "plain");
    p.setProperty(k("test", PREFIX_SOURCE), "ts");
    p.setProperty(k("test", PREFIX_SOURCE, "aaa"), "bbb");
    p.setProperty(k("test", PREFIX_DRAIN), "td");
    p.setProperty(k("test", PREFIX_DRAIN, "bbb"), "ccc");
    GateScript script = GateScript.loadFrom("testing", p, getClass().getClassLoader());
    Properties target = new Properties();
    script.storeTo(target);
    assertThat(target, is(p));
}

91. ProcessProfileTest#storeTo_multiple()

Project: asakusafw
Source File: ProcessProfileTest.java
View license
/**
     * Builds properties from multiple profiles.
     */
@Test
public void storeTo_multiple() {
    Properties p = new Properties();
    p.setProperty(ProcessProfile.KEY_PREFIX + "testing1", BasicProcessProvider.class.getName());
    p.setProperty(ProcessProfile.KEY_PREFIX + "testing1" + BaseProfile.QUALIFIER + "conf", "aaa");
    p.setProperty(ProcessProfile.KEY_PREFIX + "testing2", BasicProcessProvider.class.getName());
    p.setProperty(ProcessProfile.KEY_PREFIX + "testing2" + BaseProfile.QUALIFIER + "conf", "bbb");
    p.setProperty(ProcessProfile.KEY_PREFIX + "testing3", BasicProcessProvider.class.getName());
    p.setProperty(ProcessProfile.KEY_PREFIX + "testing3" + BaseProfile.QUALIFIER + "conf", "ccc");
    Collection<? extends ProcessProfile> profiles = ProcessProfile.loadFrom(p, ProfileContext.system(getClass().getClassLoader()));
    Properties restored = new Properties();
    for (ProcessProfile profile : profiles) {
        profile.storeTo(restored);
    }
    assertThat(restored, is(p));
}

92. ResourceProfileTest#storeTo_multiple()

Project: asakusafw
Source File: ResourceProfileTest.java
View license
/**
     * Builds properties from multiple profiles.
     */
@Test
public void storeTo_multiple() {
    Properties p = new Properties();
    p.setProperty(ResourceProfile.KEY_PREFIX + "testing1", MockResourceProvider.class.getName());
    p.setProperty(ResourceProfile.KEY_PREFIX + "testing1" + BaseProfile.QUALIFIER + "conf", "p1");
    p.setProperty(ResourceProfile.KEY_PREFIX + "testing2", MockResourceProvider.class.getName());
    p.setProperty(ResourceProfile.KEY_PREFIX + "testing2" + BaseProfile.QUALIFIER + "conf", "p2");
    p.setProperty(ResourceProfile.KEY_PREFIX + "testing3", MockResourceProvider.class.getName());
    p.setProperty(ResourceProfile.KEY_PREFIX + "testing3" + BaseProfile.QUALIFIER + "conf", "p3");
    Collection<? extends ResourceProfile> profiles = ResourceProfile.loadFrom(p, ProfileContext.system(getClass().getClassLoader()));
    Properties restored = new Properties();
    for (ResourceProfile profile : profiles) {
        profile.storeTo(restored);
    }
    assertThat(restored, is(p));
}

93. MacroTest#testLoop()

Project: bnd
Source File: MacroTest.java
View license
public static void testLoop() {
    Builder builder = new Builder();
    Properties p = new Properties();
    p.setProperty("a", "${b}");
    p.setProperty("b", "${a}");
    p.setProperty("d", "${e}");
    p.setProperty("e", "${f}");
    p.setProperty("f", "${g}");
    p.setProperty("g", "${h}");
    p.setProperty("h", "${d}");
    builder.setProperties(p);
    assertEquals("${infinite:[a,b,${b}]}", builder.getProperty("a"));
    assertEquals("${infinite:[d,h,g,f,e,${e}]}", builder.getProperty("d"));
}

94. ResourceLoaderTest#testFormatErrors()

Project: btm
Source File: ResourceLoaderTest.java
View license
public void testFormatErrors() throws Exception {
    ResourceLoader loader = new ResourceLoader();
    Properties p = new Properties();
    p.setProperty("resource.ds2.className", MockitoXADataSource.class.getName());
    p.setProperty("resource.ds2.uniqueName", "some.more.unique.Name");
    // incorrect format
    p.setProperty("resource.ds2.maxPoolSize", "abc");
    try {
        loader.initXAResourceProducers(p);
        fail("expected ResourceConfigurationException");
    } catch (ResourceConfigurationException ex) {
        assertEquals("cannot configure resource for configuration entries with name [ds2] - failing property is [maxPoolSize]", ex.getMessage());
    }
    p.setProperty("resource.ds2.className", MockitoXADataSource.class.getName());
    p.setProperty("resource.ds2.uniqueName", "some.also.other.unique.Name");
    p.setProperty("resource.ds2.maxPoolSize", "123");
    // incorrect format, will default to false
    p.setProperty("resource.ds2.useTmJoin", "unknown");
    loader.initXAResourceProducers(p);
    PoolingDataSource pds = (PoolingDataSource) loader.getResources().get("some.also.other.unique.Name");
    assertFalse(pds.getUseTmJoin());
}

95. DataTagFacadeImplTest#testCreateCacheObject()

Project: c2mon
Source File: DataTagFacadeImplTest.java
View license
@Test
public void testCreateCacheObject() throws IllegalAccessException {
    Properties properties = new Properties();
    properties.put("minValue", 1);
    properties.put("maxValue", 20);
    properties.put("name", "tag_name");
    properties.put("dataType", "String");
    properties.put("mode", 0);
    properties.put("equipmentId", "20");
    properties.put("address", "<DataTagAddress><HardwareAddress class=\"cern.c2mon.shared.common.datatag.address.impl.JAPCHardwareAddressImpl\"><protocol>yami</protocol><service>yami</service><device-name>TEST.CLIC.DIAMON.1</device-name><property-name>Acquisition</property-name><data-field-name>sys.mem.inactpct</data-field-name><column-index>-1</column-index><row-index>-1</row-index></HardwareAddress><time-to-live>3600000</time-to-live><priority>2</priority><guaranteed-delivery>false</guaranteed-delivery></DataTagAddress>");
    dataTagCache.acquireReadLockOnKey(10L);
    dataTagCache.acquireWriteLockOnKey(10L);
    EasyMock.expect(equipmentFacade.getProcessIdForAbstractEquipment(20L)).andReturn(2L);
    dataTagCache.releaseReadLockOnKey(10L);
    dataTagCache.releaseWriteLockOnKey(10L);
    EasyMock.replay(equipmentFacade);
    DataTag tag = dataTagFacade.createCacheObject(10L, properties);
    //is default as not in Spring context
    assertEquals("c2mon.client.tag.default" + "." + tag.getProcessId(), tag.getTopic());
    EasyMock.verify(equipmentFacade);
}

96. DataTagFacadeImplTest#testCreateCacheObjectForSubEquipment()

Project: c2mon
Source File: DataTagFacadeImplTest.java
View license
@Test
public void testCreateCacheObjectForSubEquipment() throws IllegalAccessException {
    Properties properties = new Properties();
    properties.put("minValue", 1);
    properties.put("maxValue", 20);
    properties.put("name", "tag_name");
    properties.put("dataType", "String");
    properties.put("mode", 0);
    properties.put("subEquipmentId", "30");
    properties.put("address", "<DataTagAddress><HardwareAddress class=\"cern.c2mon.shared.common.datatag.address.impl.JAPCHardwareAddressImpl\"><protocol>yami</protocol><service>yami</service><device-name>TEST.CLIC.DIAMON.1</device-name><property-name>Acquisition</property-name><data-field-name>sys.mem.inactpct</data-field-name><column-index>-1</column-index><row-index>-1</row-index></HardwareAddress><time-to-live>3600000</time-to-live><priority>2</priority><guaranteed-delivery>false</guaranteed-delivery></DataTagAddress>");
    dataTagCache.acquireReadLockOnKey(11L);
    dataTagCache.acquireWriteLockOnKey(11L);
    EasyMock.expect(subEquipmentFacade.getProcessIdForAbstractEquipment(30L)).andReturn(2L);
    dataTagCache.releaseReadLockOnKey(11L);
    dataTagCache.releaseWriteLockOnKey(11L);
    EasyMock.replay(subEquipmentFacade);
    DataTag tag = dataTagFacade.createCacheObject(11L, properties);
    //is default as not in Spring context
    assertEquals("c2mon.client.tag.default" + "." + tag.getProcessId(), tag.getTopic());
    EasyMock.verify(subEquipmentFacade);
}

97. ProcessFacadeImplTest#testCreateCacheObject()

Project: c2mon
Source File: ProcessFacadeImplTest.java
View license
@Test
public void testCreateCacheObject() throws IllegalAccessException {
    Properties properties = new Properties();
    properties.put("name", "P_NAME");
    properties.put("description", "description");
    properties.put("maxMessageSize", 3);
    properties.put("maxMessageDelay", 500);
    properties.put("stateTagId", "4");
    properties.put("aliveTagId", "3");
    properties.put("aliveInterval", 20000);
    processCache.acquireReadLockOnKey(1L);
    processCache.releaseReadLockOnKey(1L);
    control.replay();
    Process process = processFacade.createCacheObject(1L, properties);
    control.verify();
}

98. MllpTcpClientProducerBlueprintTest#useOverridePropertiesWithPropertiesComponent()

View license
@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
    Properties props = new Properties();
    props.setProperty("sourceUri", sourceUri);
    props.setProperty("acknowledgedUri", mockAcknowledgedUri);
    props.setProperty("timeoutUri", mockTimeoutUri);
    props.setProperty("frameErrorUri", mockFrameExUri);
    props.setProperty("errorAcknowledgementUri", mockAeExUri);
    props.setProperty("rejectAcknowledgementUri", mockArExUri);
    props.setProperty("mllp.port", Integer.toString(mllpServer.getListenPort()));
    return props;
}

99. AbstractBuildExecutor#getContinuumSystemProperties()

View license
protected Properties getContinuumSystemProperties(Project project) {
    Properties properties = new Properties();
    properties.setProperty("continuum.project.group.name", project.getProjectGroup().getName());
    properties.setProperty("continuum.project.lastBuild.state", String.valueOf(project.getOldState()));
    properties.setProperty("continuum.project.lastBuild.number", String.valueOf(project.getBuildNumber()));
    properties.setProperty("continuum.project.nextBuild.number", String.valueOf(project.getBuildNumber() + 1));
    properties.setProperty("continuum.project.id", String.valueOf(project.getId()));
    properties.setProperty("continuum.project.name", project.getName());
    properties.setProperty("continuum.project.version", project.getVersion());
    return properties;
}

100. AbstractBuildExecutor#getContinuumSystemProperties()

View license
protected Properties getContinuumSystemProperties(Project project) {
    Properties properties = new Properties();
    properties.setProperty("continuum.project.group.name", project.getProjectGroup().getName());
    properties.setProperty("continuum.project.lastBuild.state", String.valueOf(project.getOldState()));
    properties.setProperty("continuum.project.lastBuild.number", String.valueOf(project.getBuildNumber()));
    properties.setProperty("continuum.project.nextBuild.number", String.valueOf(project.getBuildNumber() + 1));
    properties.setProperty("continuum.project.id", String.valueOf(project.getId()));
    properties.setProperty("continuum.project.name", project.getName());
    properties.setProperty("continuum.project.version", project.getVersion());
    return properties;
}