List of usage examples for org.apache.commons.configuration BaseConfiguration BaseConfiguration
BaseConfiguration
From source file:org.qucosa.camel.component.opus4.Opus4DataSourceIT.java
@Before public void setUp() throws SQLException, ConfigurationException { Configuration conf = new BaseConfiguration(); conf.setProperty(Opus4DataSource.WEBAPI_PARAM_QUCOSA_HOST, "http://www.example.com"); conf.setProperty(Opus4DataSource.DB_PARAM_HOST, "jdbc:h2:mem:test;" + "INIT=RUNSCRIPT FROM 'classpath:QucosaProviderTest-DB_SETUP.sql' CHARSET 'UTF-8'"); conf.setProperty(Opus4DataSource.DB_PARAM_USER, "test"); conf.setProperty(Opus4DataSource.DB_PARAM_PASSWORD, "test"); qucosaProvider = new Opus4DataSource(); qucosaProvider.configure(conf);/*from w ww.j av a 2s. c o m*/ }
From source file:org.qucosa.opus.Opus4ImmutableRepositoryTest.java
@Before public void setUp() throws SQLException, ConfigurationException { Configuration conf = new BaseConfiguration(); conf.setProperty(Opus4ImmutableRepository.WEBAPI_PARAM_QUCOSA_HOST, "http://www.example.com"); conf.setProperty(Opus4ImmutableRepository.WEBAPI_PARAM_QUCOSA_ROLE, "admin"); conf.setProperty(Opus4ImmutableRepository.DB_PARAM_HOST, "jdbc:h2:mem:test;" + "INIT=RUNSCRIPT FROM 'classpath:QucosaProviderTest-DB_SETUP.sql' CHARSET 'UTF-8'"); conf.setProperty(Opus4ImmutableRepository.DB_PARAM_USER, "test"); conf.setProperty(Opus4ImmutableRepository.DB_PARAM_PASSWORD, "test"); qucosaProvider = new Opus4ImmutableRepository(); qucosaProvider.configure(conf);/*w w w.ja v a 2s. c o m*/ }
From source file:org.rzo.yajsw.config.YajswConfigurationImpl.java
/** * Gets the configuration./* w w w . j ava2 s.c o m*/ * * @param map * the map * * @return the configuration */ private Configuration getConfiguration(Map map) { Configuration result = new BaseConfiguration(); if (map != null) for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Entry entry = (Entry) it.next(); result.addProperty((String) entry.getKey(), entry.getValue()); } return result; }
From source file:org.rzo.yajsw.os.ms.win.w32.WindowsJavaHome.java
/** * The main method.//from w w w. j a va 2 s .co m * * @param args * the arguments */ public static void main(String[] args) { Configuration conf = new BaseConfiguration(); conf.setProperty("wrapper.java.command", "java"); WindowsJavaHome javaHome = new WindowsJavaHome(conf); System.out.println(javaHome.findJava()); conf.setProperty("wrapper.java.customProcName", "test"); javaHome = new WindowsJavaHome(conf); System.out.println(javaHome.findJava()); conf.setProperty("wrapper.java.command", "javaw"); javaHome = new WindowsJavaHome(conf); System.out.println(javaHome.findJava()); conf.clear(); conf.setProperty("wrapper.java.minversion", "1.5.0"); conf.setProperty("wrapper.java.maxversion", "1.5.99"); conf.setProperty("wrapper.java.customProcName", "test"); javaHome = new WindowsJavaHome(conf); System.out.println(javaHome.findJava()); conf.clear(); conf.setProperty("wrapper.java.minversion", "1.6.0"); conf.setProperty("wrapper.java.customProcName", "test"); conf.setProperty("wrapper.java.preferJdk", true); javaHome = new WindowsJavaHome(conf); System.out.println(javaHome.findJava()); }
From source file:org.rzo.yajsw.wrapper.FileUtils.java
/** * The main method./*ww w . ja v a 2s. com*/ * * @param args * the arguments */ public static void main(String[] args) { try { // String // fileName=FilenameUtils.separatorsToSystem("C:\\init\\MOBILEguard\\yajsw/lib/jvmstat/*.jar"); // System.out.println("FileName: "+fileName); CompositeConfiguration compConfig = new CompositeConfiguration(); AbstractConfiguration configuraton = new BaseConfiguration(); compConfig.addConfiguration(new EnvironmentConfiguration()); configuraton.setProperty("wrapper.java.classpath.1", "${VERSANT_ROOT}/lib/jvi.*jar"); configuraton.setProperty("wrapper.java.classpath.2", "${GROOVY_HOME}/lib/*.jar"); compConfig.addConfiguration(configuraton); System.out.println("Configuration: " + ConfigurationConverter.getProperties(compConfig)); System.out .println("subset: " + ConfigurationConverter.getProperties(compConfig.subset("wrapper.java"))); // Collection files=FileUtils.getFiles("../..", // "C:/versant/7_0_1/lib/jvi*.jar"); // Collection collection= // org.apache.commons.io.FileUtils.listFiles(new File("C:/"), // new WildcardFileFilter("jvi*.jar"), new // WildcardFileFilter("*jar")); // File[] files= new // File("C:").listFiles((FilenameFilter)FileFilterUtils.nameFileFilter("C:/versant/7_0_1/lib/jvi*.jar")); // // FileUtils.getFiles("C:/versant/7_0_1/lib/", "jvi*.jar"); // System.out.println("FileList="+ // FileUtils.getFiles("C:/versant/7_0_1/lib/", "jvi*.jar")); // java.util.Arrays.asList(files)); } catch (Exception ex) { ex.printStackTrace(); } }
From source file:org.seedstack.jms.internal.FakeConnectionFactoryImpl.java
public FakeConnectionFactoryImpl() { super("test", new BaseConfiguration(), new HashMap<String, Context>()); }
From source file:org.seedstack.seed.ws.internal.jms.SoapJmsUri.java
Configuration getConfiguration(Configuration wsConfiguration) { if (endpointName != null) { return wsConfiguration.subset(String.format("endpoint.%s.jms", endpointName)); } else {/*from w ww. jav a2 s . co m*/ return new BaseConfiguration(); } }
From source file:org.sonar.ant.LauncherTest.java
@Test public void testGetSqlLevel() throws Exception { Configuration conf = new BaseConfiguration(); assertThat(Launcher.getSqlLevel(conf), is("WARN")); conf.setProperty("sonar.showSql", "true"); assertThat(Launcher.getSqlLevel(conf), is("DEBUG")); conf.setProperty("sonar.showSql", "false"); assertThat(Launcher.getSqlLevel(conf), is("WARN")); }
From source file:org.sonar.ant.LauncherTest.java
@Test public void testGetSqlResultsLevel() throws Exception { Configuration conf = new BaseConfiguration(); assertThat(Launcher.getSqlResultsLevel(conf), is("WARN")); conf.setProperty("sonar.showSqlResults", "true"); assertThat(Launcher.getSqlResultsLevel(conf), is("DEBUG")); conf.setProperty("sonar.showSqlResults", "false"); assertThat(Launcher.getSqlResultsLevel(conf), is("WARN")); }
From source file:org.sonar.batch.bootstrap.BatchSettingsTest.java
@Before public void before() { project = ProjectDefinition.create(); project.setKey("struts"); reactor = new ProjectReactor(project); deprecatedConf = new BaseConfiguration(); client = mock(ServerClient.class); when(client.request("/batch_bootstrap/properties?project=struts")) .thenReturn("[{\"k\":\"sonar.cpd.cross\",\"v\":\"true\"}," + "{\"k\":\"sonar.java.coveragePlugin\",\"v\":\"jacoco\",\"p\":\"struts\"}," + "{\"k\":\"sonar.java.coveragePlugin\",\"v\":\"cobertura\",\"p\":\"struts-core\"}]"); bootstrapSettings = new BootstrapSettings(reactor, new GlobalBatchProperties()); }