Example usage for java.util Properties setProperty

List of usage examples for java.util Properties setProperty

Introduction

In this page you can find the example usage for java.util Properties setProperty.

Prototype

public synchronized Object setProperty(String key, String value) 

Source Link

Document

Calls the Hashtable method put .

Usage

From source file:com.sap.prd.mobile.ios.mios.SpecificTargetTest.java

@Test
public void buildSpecificTarget() throws Exception {
    final String testName = getTestName();
    final File remoteRepositoryDirectory = getRemoteRepositoryDirectory(getClass().getName());
    prepareRemoteRepository(remoteRepositoryDirectory);

    Map<String, String> additionalSystemProperties = new HashMap<String, String>();
    additionalSystemProperties.put("xcode.app.defaultConfigurations", "Release");
    additionalSystemProperties.put("xcode.app.defaultSdks", "iphoneos");
    additionalSystemProperties.put("xcode.target", "Target2");

    Properties pomReplacements = new Properties();
    pomReplacements.setProperty(PROP_NAME_DEPLOY_REPO_DIR, remoteRepositoryDirectory.getAbsolutePath());
    pomReplacements.setProperty(PROP_NAME_DYNAMIC_VERSION, "1.0." + String.valueOf(System.currentTimeMillis()));

    Verifier verifier = test(testName, new File(getTestRootDirectory(), "multiple-targets/MultipleTargets"),
            "compile", THE_EMPTY_LIST, additionalSystemProperties, pomReplacements, new NullProjectModifier());
    assertCorrectTargetBuild(new File(verifier.getBasedir(), verifier.getLogFileName()));
}

From source file:org.springsource.jta.etailer.store.config.PersistenceConfiguration.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManager() throws Throwable {
    LocalContainerEntityManagerFactoryBean entityManager = new LocalContainerEntityManagerFactoryBean();
    entityManager.setPersistenceUnitName("persistenceUnit");
    entityManager.setDataSource(jtaConfiguration.dataSource());
    entityManager.setJpaVendorAdapter(hibernateJpaVendorAdapter());

    Properties properties = new Properties();
    properties.setProperty("hibernate.dialect", MySQL5Dialect.class.getName());
    properties.setProperty("hibernate.ejb.naming_strategy", ImprovedNamingStrategy.class.getName());
    jtaConfiguration.tailorProperties(properties);
    entityManager.setJpaProperties(properties);

    return entityManager;
}

From source file:KafkaTestBroker.java

private kafka.server.KafkaConfig buildKafkaConfig(String zookeeperConnectionString) {
    Properties p = new Properties();
    p.setProperty("zookeeper.connect", zookeeperConnectionString);//127.0.0.1:51564
    p.setProperty("broker.id", "0");
    p.setProperty("port", "" + port);
    p.setProperty("log.dirs", logDir.getAbsolutePath());//E:\zookper\kafka\logs\kafka-test-51654
    return new KafkaConfig(p);
}

From source file:io.cloudslang.schema.context.ScoreDatabaseContext.java

@Bean
Properties jpaProperties() {/*from www  . j  a va2s  .  c om*/
    Properties props = new Properties();
    props.setProperty("hibernate.format_sql", Boolean.TRUE.toString());
    props.setProperty("hibernate.hbm2ddl.auto", System.getProperty("hibernate.hbm2ddl.auto", "validate"));
    props.setProperty("hibernate.cache.use_query_cache", Boolean.FALSE.toString());
    props.setProperty("hibernate.generate_statistics", Boolean.FALSE.toString());
    props.setProperty("hibernate.cache.use_second_level_cache", Boolean.FALSE.toString());
    props.setProperty("hibernate.order_updates", Boolean.TRUE.toString());
    props.setProperty("hibernate.order_inserts", Boolean.TRUE.toString());
    props.setProperty("hibernate.dialect_resolvers", "io.cloudslang.engine.dialects.ScoreDialectResolver");
    return props;
}

From source file:com.citruspay.mobile.payment.oauth2.PropertiesFileTokenStore.java

@Override
public void store(String key, OAuth2Token token) {
    // update store
    Properties tokens = loadAsProperties();
    tokens.setProperty(key, token.asJSON().toString());
    storeAsProperties(tokens);//from   w  ww  .  j a v a  2s .  com
}

From source file:com.linkedin.drelephant.mapreduce.heuristics.ReducerMemoryHeuristicTest.java

private Severity analyzeJob(long taskAvgMemMB, long containerMemMB) throws IOException {
    MapReduceCounterData jobCounter = new MapReduceCounterData();
    MapReduceTaskData[] reducers = new MapReduceTaskData[NUMTASKS];

    MapReduceCounterData counter = new MapReduceCounterData();
    counter.set(MapReduceCounterData.CounterName.PHYSICAL_MEMORY_BYTES, taskAvgMemMB * FileUtils.ONE_MB);

    Properties p = new Properties();
    p.setProperty(ReducerMemoryHeuristic.REDUCER_MEMORY_CONF, Long.toString(containerMemMB));

    int i = 0;/*from  w ww .j  a  va 2s  . co  m*/
    for (; i < NUMTASKS; i++) {
        reducers[i] = new MapReduceTaskData(counter, new long[5]);
    }

    MapReduceApplicationData data = new MapReduceApplicationData().setCounters(jobCounter)
            .setReducerData(reducers);
    data.setJobConf(p);
    HeuristicResult result = _heuristic.apply(data);
    return result.getSeverity();
}

From source file:com.linkedin.drelephant.mapreduce.heuristics.MapperMemoryHeuristicTest.java

private Severity analyzeJob(long taskAvgMemMB, long containerMemMB) throws IOException {
    MapReduceCounterData jobCounter = new MapReduceCounterData();
    MapReduceTaskData[] mappers = new MapReduceTaskData[NUMTASKS];

    MapReduceCounterData counter = new MapReduceCounterData();
    counter.set(MapReduceCounterData.CounterName.PHYSICAL_MEMORY_BYTES, taskAvgMemMB * FileUtils.ONE_MB);

    Properties p = new Properties();
    p.setProperty(MapperMemoryHeuristic.MAPPER_MEMORY_CONF, Long.toString(containerMemMB));

    int i = 0;/*  w  ww  .  j a  v a  2  s.c  o  m*/
    for (; i < NUMTASKS; i++) {
        mappers[i] = new MapReduceTaskData(counter, new long[5]);
    }

    MapReduceApplicationData data = new MapReduceApplicationData().setCounters(jobCounter)
            .setMapperData(mappers);
    data.setJobConf(p);
    HeuristicResult result = _heuristic.apply(data);
    return result.getSeverity();
}

From source file:org.slc.sli.ingestion.landingzone.BatchJobAssemblerTest.java

@Test
public void testAssembleJobValid() throws IOException {

    // Set up some valid entries
    ArrayList<IngestionFileEntry> entries = new ArrayList<IngestionFileEntry>();
    entries.add(new IngestionFileEntry(FileFormat.EDFI_XML, FileType.XML_STUDENT_PARENT_ASSOCIATION,
            "InterchangeStudent.xml", MD5.calculate("InterchangeStudent.xml", getLandingZone())));
    entries.add(new IngestionFileEntry(FileFormat.EDFI_XML, FileType.XML_STUDENT_ENROLLMENT,
            "InterchangeEnrollment.xml", MD5.calculate("InterchangeEnrollment.xml", getLandingZone())));

    // Set up some valid properties
    Properties props = new Properties();
    props.setProperty("hello", "world");

    ControlFile ctlFile = new ControlFile(null, entries, props);

    Job job = jobAssembler.assembleJob(new ControlFileDescriptor(ctlFile, getLandingZone()));

    assertEquals(2, job.getFiles().size());
    assertEquals("world", job.getProperty("hello"));

}

From source file:com.greendot.db.jpa.configuration.JpaDatabaseConfiguration.java

private Properties jpaHibernateProperties() {

    final Properties properties = new Properties();
    properties.setProperty("hibernate.hbm2ddl.auto", environment.getProperty("db.hibernate.hbm2ddl.auto"));
    properties.setProperty("hibernate.dialect", environment.getProperty("db.hibernate.dialect"));

    return properties;
}

From source file:de.hska.ld.core.config.VelocityConfig.java

@Bean
public VelocityEngineFactoryBean velocityEngine() {
    VelocityEngineFactoryBean factoryBean = new VelocityEngineFactoryBean();
    Properties properties = new Properties();
    properties.put("resource.loader", "class");
    properties.setProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
    factoryBean.setVelocityProperties(properties);
    return factoryBean;
}