Example usage for java.util Properties put

List of usage examples for java.util Properties put

Introduction

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

Prototype

@Override
    public synchronized Object put(Object key, Object value) 

Source Link

Usage

From source file:com.infodev.fcgorole.configuration.AppConfig.java

private Properties getHibernateProperties() {
    Properties prop = new Properties();
    prop.put("hibernate.format_sql", "true");
    prop.put("hibernate.show_sql", "true");
    prop.put("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
    return prop;// ww  w.ja  v a  2  s . c  o  m
}

From source file:at.christophwurst.orm.config.AppConfig.java

private Properties testProperties() {
    Properties properties = new Properties();
    properties.put("hibernate.dialect", "org.hibernate.dialect.MySQL5InnoDBDialect");
    properties.put("hibernate.show_sql", "false");
    properties.put("hibernate.format_sql", "false");
    properties.put("hibernate.hbm2ddl.auto", "update");
    return properties;
}

From source file:at.christophwurst.orm.config.IntegrationalTestsConfig.java

private Properties testProperties() {
    Properties properties = new Properties();
    properties.put("hibernate.dialect", "org.hibernate.dialect.DerbyTenSevenDialect");
    properties.put("hibernate.show_sql", "true");
    properties.put("hibernate.format_sql", "false");
    properties.put("hibernate.hbm2ddl.auto", "create");
    return properties;
}

From source file:py.una.pol.karaku.services.server.KarakuWSServerConfiguration.java

@Bean
public EndpointExceptionResolver exceptionResolver() {

    EndpointExceptionResolver toRet = new EndpointExceptionResolver();

    SoapFaultDefinition sfd = new SoapFaultDefinition();
    sfd.setFaultCode(SoapFaultDefinition.SERVER);
    toRet.setDefaultFault(sfd);//from w w w .  java 2  s .c  o m

    Properties properties = new Properties();
    properties.put(HTTPException.class.getName(), "CLIENT,Invalid request");

    toRet.setExceptionMappings(properties);

    toRet.setOrder(1);

    return toRet;
}

From source file:com.metamx.emitter.core.HttpEmitterConfigTest.java

@Test
public void testDefaults() {
    final Properties props = new Properties();
    props.put("com.metamx.emitter.http.url", "http://example.com/");

    final ObjectMapper objectMapper = new ObjectMapper();
    final HttpEmitterConfig config = objectMapper.convertValue(Emitters.makeHttpMap(props),
            HttpEmitterConfig.class);

    Assert.assertEquals(60000, config.getFlushMillis());
    Assert.assertEquals(300, config.getFlushCount());
    Assert.assertEquals("http://example.com/", config.getRecipientBaseUrl());
    Assert.assertEquals(null, config.getBasicAuthentication());
    Assert.assertEquals(BatchingStrategy.ARRAY, config.getBatchingStrategy());
    Assert.assertEquals(5 * 1024 * 1024, config.getMaxBatchSize());
    Assert.assertEquals(250 * 1024 * 1024, config.getMaxBufferSize());
}

From source file:ly.stealth.kafka.metrics.MetricsReportingSteps.java

private ConsumerConfig createConsumerConfig() {
    Properties props = new Properties();
    props.put("zookeeper.connect", zkConnect);
    props.put("group.id", UUID.randomUUID().toString());
    props.put("auto.offset.reset", "smallest");
    props.put("zookeeper.session.timeout.ms", "30000");
    props.put("consumer.timeout.ms", "30000");
    return new ConsumerConfig(props);
}

From source file:com.espertech.esper.epl.db.TestDatabaseDSConnFactory.java

public void setUp() {
    MysqlDataSource mySQLDataSource = new MysqlDataSource();
    mySQLDataSource.setUser(SupportDatabaseService.DBUSER);
    mySQLDataSource.setPassword(SupportDatabaseService.DBPWD);
    mySQLDataSource.setURL("jdbc:mysql://localhost/test");

    String envName = "java:comp/env/jdbc/MySQLDB";
    SupportInitialContextFactory.addContextEntry(envName, mySQLDataSource);

    ConfigurationDBRef config = new ConfigurationDBRef();
    Properties properties = new Properties();
    properties.put("java.naming.factory.initial", SupportInitialContextFactory.class.getName());
    config.setDataSourceConnection(envName, properties);

    databaseDSConnFactory = new DatabaseDSConnFactory(
            (ConfigurationDBRef.DataSourceConnection) config.getConnectionFactoryDesc(),
            config.getConnectionSettings());
}

From source file:com.tukaloff.customers.Config.java

@Bean
public SessionFactory sessionFactory() {
    LocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource());
    sessionBuilder.addAnnotatedClasses(CustomersAuth.class);
    sessionBuilder.addAnnotatedClasses(CustomersAuthHistory.class);
    Properties props = new Properties();
    props.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
    props.put("hibernate.current_session_context_class", "thread");
    props.put("hibernate.connection.url",
            "jdbc:mysql://localhost/customers?useJDBCCompliantTimezoneShift=true&serverTimezone=UTC");
    props.put("hibernate.connection.username", "root");
    props.put("hibernate.connection.password", "root");
    props.put("hibernate.hbm2ddl.auto", "update");
    sessionBuilder.setProperties(props);
    return sessionBuilder.buildSessionFactory();
}

From source file:com.anuz.dummyapi.config.HibernateConfig.java

@Bean
public Properties getHibernateProperties() {
    Properties properties = new Properties();
    properties.put("hibernate.dialect", hibernateDialect);
    properties.put("hibernate.show_sql", hibernateShowSql);
    properties.put("hibernate.current_session_context_class", currentSessionContextClass);
    return properties;
}

From source file:com.bt.aloha.testing.AlternateConcurrentUpdateFailureDialogCollectionStub.java

@Override
public void replace(DialogInfo dialogInfo) {
    if (dialogInfo.getStringProperty(ALTERNATE_FAILURE, null) == null) {
        DialogInfo dummyDialogInfo = get(dialogInfo.getId());
        Properties props = new Properties();
        props.put(ALTERNATE_FAILURE, "true");
        dummyDialogInfo.setProperties(props);
        LOG.debug(String.format(//from   w  w  w  .j a  v a2 s .co m
                "Replacing dialoginfo %s (version %s, hash %s) with dummy object (version %s, object %s)",
                dialogInfo.getId(), dialogInfo.getVersionId(), dialogInfo.hashCode(),
                dummyDialogInfo.getVersionId(), dummyDialogInfo.hashCode()));
        super.replace(dummyDialogInfo);
        LOG.debug(String.format(
                "Replaced dialoginfo %s (version %s, hash %s) with dummy object (version %s, object %s)",
                dialogInfo.getId(), dialogInfo.getVersionId(), dialogInfo.hashCode(),
                dummyDialogInfo.getVersionId(), dummyDialogInfo.hashCode()));
    } else {
        dialogInfo.setProperties(null);
    }

    LOG.debug(String.format("Replacing dialoginfo %s (version %s, hash %s)", dialogInfo.getId(),
            dialogInfo.getVersionId(), dialogInfo.hashCode()));
    super.replace(dialogInfo);
}