private void setupExamProperties(File karafHome, ExamSystem system) throws IOException { File customPropertiesFile = new File(karafHome + "/etc/system.properties"); SystemPropertyOption[] customProps = system.getOptions(SystemPropertyOption.class); Properties karafPropertyFile = new Properties(); karafPropertyFile.load(new FileInputStream(customPropertiesFile)); for (SystemPropertyOption systemPropertyOption : customProps) { karafPropertyFile.put(systemPropertyOption.getKey(), systemPropertyOption.getValue()); } karafPropertyFile.store(new FileOutputStream(customPropertiesFile), "updated by pax-exam"); }
/** * Setup system properties. * * @param options options * @throws IOException */ private void setupSystemProperties(List<String> options, ExamSystem examSystem) throws IOException { Arrays.asList(examSystem.getOptions(SystemPropertyOption.class)).forEach(systemPropertyOption -> { String property = String.format("-D%s=%s", systemPropertyOption.getKey(), systemPropertyOption.getValue()); options.add(property); }); }
/** * Setup system properties. * * @param options options * @throws IOException */ private void setupSystemProperties(List<String> options, ExamSystem examSystem) throws IOException { Arrays.asList(examSystem.getOptions(SystemPropertyOption.class)).forEach(systemPropertyOption -> { String property = String.format("-D%s=%s", systemPropertyOption.getKey(), systemPropertyOption.getValue()); options.add(property); }); }
protected String getSystemProperty(String key) { SystemPropertyOption[] systemProperties = examSystem.getOptions(SystemPropertyOption.class); if (systemProperties != null) { for (SystemPropertyOption systemPropertyOption : systemProperties) { if (key.equals(systemPropertyOption.getKey())) { return systemPropertyOption.getValue(); } } } return null; } }
private void setupSystemProperties(File karafHome, ExamSystem _system) throws IOException { File customPropertiesFile = new File(karafHome, framework.getKarafEtc() + "/system.properties"); SystemPropertyOption[] customProps = _system.getOptions(SystemPropertyOption.class); Properties karafPropertyFile = new Properties(); karafPropertyFile.load(new FileInputStream(customPropertiesFile)); for (SystemPropertyOption systemPropertyOption : customProps) { karafPropertyFile.put(systemPropertyOption.getKey(), systemPropertyOption.getValue()); } for (PropagateSystemPropertyOption option : system.getOptions(PropagateSystemPropertyOption.class)) { String key = option.getKey(); String value = System.getProperty(key); if (value != null) { karafPropertyFile.put(key, value); } } karafPropertyFile.store(new FileOutputStream(customPropertiesFile), "updated by pax-exam"); }
private void setupSystemProperties(File karafHome, ExamSystem _system) throws IOException { File customPropertiesFile = new File(karafHome, framework.getKarafEtc() + "/system.properties"); SystemPropertyOption[] customProps = _system.getOptions(SystemPropertyOption.class); Properties karafPropertyFile = new Properties(); karafPropertyFile.load(new FileInputStream(customPropertiesFile)); for (SystemPropertyOption systemPropertyOption : customProps) { karafPropertyFile.put(systemPropertyOption.getKey(), systemPropertyOption.getValue()); } for (PropagateSystemPropertyOption option : system.getOptions(PropagateSystemPropertyOption.class)) { String key = option.getKey(); String value = System.getProperty(key); if (value != null) { karafPropertyFile.put(key, value); } } karafPropertyFile.store(new FileOutputStream(customPropertiesFile), "updated by pax-exam"); }
private void setSystemProperties() { for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { System.setProperty(option.getKey(), option.getValue()); } String repositories = join(system.getOptions(RepositoryOption.class)); if (!repositories.isEmpty()) { System.setProperty("org.ops4j.pax.url.mvn.repositories", repositories); } if (LOG.isDebugEnabled()) { logSystemProperties(); } }
vmOptions = vmOptions + " -D" + sysOption.getKey() + "=" + sysOption.getValue();
argument.append( "-D" ).append( property.getKey() ).append( "=" ).append( property.getValue() );
vmOptions = vmOptions + " -D" + sysOption.getKey() + "=" + sysOption.getValue();
argument.append( " " ); argument.append( "-D" ).append( property.getKey() ).append( "=" ).append( property.getValue() );
private Map<String, String> createSystemProperties() { Map<String, String> p = new HashMap<String, String>(); for (PropagateSystemPropertyOption option : system .getOptions(PropagateSystemPropertyOption.class)) { String key = option.getKey(); String value = System.getProperty(key); if (value != null) { p.put(key, value); } } for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { p.put(option.getKey(), option.getValue()); } RepositoryOption[] repositories = system.getOptions(RepositoryOption.class); if (repositories.length != 0) { System.setProperty("org.ops4j.pax.url.mvn.repositories", join(repositories)); } return p; }
private Map<String, Object> createFrameworkProperties() throws IOException { final Map<String, Object> p = new HashMap<String, Object>(); p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); SystemPackageOption[] systemPackageOptions = system.getOptions(SystemPackageOption.class); if (systemPackageOptions.length > 0) { p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, join(systemPackageOptions)); } p.put(FRAMEWORK_BOOTDELEGATION, join(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), option.getValue()); } for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { System.setProperty(option.getKey(), option.getValue()); } return p; }
bundles.append(option.getValue());
private Map<String, String> createFrameworkProperties() throws IOException { final Map<String, String> p = new HashMap<String, String>(); CleanCachesOption cleanCaches = system.getSingleOption(CleanCachesOption.class); if (cleanCaches != null && cleanCaches.getValue() != null && cleanCaches.getValue()) { p.put(FRAMEWORK_STORAGE_CLEAN, FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); } p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, buildString(system.getOptions(SystemPackageOption.class))); p.put(FRAMEWORK_BOOTDELEGATION, buildString(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), (String) option.getValue()); } for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { System.setProperty(option.getKey(), option.getValue()); } String repositories = buildString(system.getOptions(RepositoryOption.class)); if (!repositories.isEmpty()) { System.setProperty("org.ops4j.pax.url.mvn.repositories", repositories); } return p; }
System.setProperty(option.getKey(), option.getValue());