private boolean shouldDeleteRuntime() { boolean deleteRuntime = true; KeepRuntimeFolderOption[] keepRuntimeFolder = system .getOptions(KeepRuntimeFolderOption.class); if (keepRuntimeFolder != null && keepRuntimeFolder.length != 0) { deleteRuntime = false; } return deleteRuntime; }
private boolean shouldInjectJUnitBundles(ExamSystem _system) { Option[] options = _system.getOptions(OverrideJUnitBundlesOption.class); LOGGER.info("Found {} options when requesting OverrideJUnitBundlesOption.class", options.length); return options.length == 0; }
private void appendVmSettingsFromSystem(ArrayList<String> opts, ExamSystem subsystem) { VMOption[] options = subsystem.getOptions(VMOption.class); for (VMOption option : options) { opts.add(option.getOption()); } }
private void appendVmSettingsFromSystem(ArrayList<String> opts, ExamSystem subsystem) { VMOption[] options = subsystem.getOptions(VMOption.class); for (VMOption option : options) { opts.add(option.getOption()); } }
/** * Set repositories specified in the Repository Option. */ private void addRepositories() { RepositoryOption[] repositories = system.getOptions(RepositoryOption.class); if (repositories.length != 0) { System.setProperty("org.ops4j.pax.url.mvn.repositories", buildString(repositories)); } }
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); }); }
private Collection<? extends KarafDistributionConfigurationFileOption> configureSystemPackages( ExamSystem subsystem) { String systemPackages = JoinUtil.join(subsystem.getOptions(SystemPackageOption.class)); if (systemPackages.length() == 0) { return Arrays.asList(); } return Arrays.asList(new KarafDistributionConfigurationFileExtendOption( CustomProperties.SYSTEM_PACKAGES_EXTRA, systemPackages)); }
private Collection<? extends KarafDistributionConfigurationFileOption> configureBootDelegation( ExamSystem subsystem) { BootDelegationOption[] bootDelegationOptions = subsystem .getOptions(BootDelegationOption.class); return Arrays.asList(new KarafDistributionConfigurationFileExtendOption( CustomProperties.BOOTDELEGATION, JoinUtil.join(bootDelegationOptions))); }
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 Collection<? extends KarafDistributionConfigurationFileOption> configureBootDelegation(ExamSystem subsystem) { BootDelegationOption[] bootDelegationOptions = subsystem.getOptions(BootDelegationOption.class); String bootDelegationString = ""; for (BootDelegationOption bootDelegationOption : bootDelegationOptions) { bootDelegationString += ","; bootDelegationString += bootDelegationOption.getValue(); } return Lists.newArrayList(new KarafDistributionConfigurationFileExtendOption(CustomProperties.BOOTDELEGATION, bootDelegationString)); }
private Collection<? extends KarafDistributionConfigurationFileOption> configureBootDelegation( ExamSystem subsystem) { BootDelegationOption[] bootDelegationOptions = subsystem .getOptions(BootDelegationOption.class); return Arrays.asList(new KarafDistributionConfigurationFileExtendOption( CustomProperties.BOOTDELEGATION, JoinUtil.join(bootDelegationOptions))); }
private String retrieveRealLogLevel(ExamSystem _system) { LogLevelOption[] logLevelOptions = _system.getOptions(LogLevelOption.class); return logLevelOptions != null && logLevelOptions.length != 0 ? logLevelOptions[0] .getLogLevel().toString() : "WARN"; }
private String retrieveRealLogLevel(ExamSystem system) { LogLevelOption[] logLevelOptions = system.getOptions(LogLevelOption.class); return logLevelOptions != null && logLevelOptions.length != 0 ? logLevelOptions[0].getLogLevel().toString() : "WARN"; }
private String retrieveRealLogLevel(ExamSystem _system) { LogLevelOption[] logLevelOptions = _system.getOptions(LogLevelOption.class); return logLevelOptions != null && logLevelOptions.length != 0 ? logLevelOptions[0] .getLogLevel().toString() : "WARN"; }
private void copyBootClasspathLibraries(File karafHome, ExamSystem subsystem) throws MalformedURLException, IOException { BootClasspathLibraryOption[] bootClasspathLibraryOptions = subsystem.getOptions(BootClasspathLibraryOption.class); for (BootClasspathLibraryOption bootClasspathLibraryOption : bootClasspathLibraryOptions) { UrlReference libraryUrl = bootClasspathLibraryOption.getLibraryUrl(); FileUtils.copyURLToFile( new URL(libraryUrl.getURL()), createFileNameWithRandomPrefixFromUrlAtTarget(libraryUrl.getURL(), new File(karafHome + "/lib"), new String[]{"jar"})); } }
public void deployModules() { UrlDeploymentOption[] deploymentOptions = system.getOptions(UrlDeploymentOption.class); int numModules = 0; for (UrlDeploymentOption option : deploymentOptions) { numModules++; if (option.getName() == null) { option.name("app" + numModules); } deployModule(option); } }
private Option getInvokerConfiguration() { KarafExamSystemConfigurationOption[] internalConfigurationOptions = system .getOptions(KarafExamSystemConfigurationOption.class); Option invokerConfiguration = systemProperty("pax.exam.invoker").value("junit"); if (internalConfigurationOptions != null && internalConfigurationOptions.length != 0) { invokerConfiguration = systemProperty("pax.exam.invoker").value( internalConfigurationOptions[0].getInvoker()); } return invokerConfiguration; }
private Option getInvokerConfiguration() { KarafExamSystemConfigurationOption[] internalConfigurationOptions = system .getOptions(KarafExamSystemConfigurationOption.class); Option invokerConfiguration = systemProperty("pax.exam.invoker").value("junit"); if (internalConfigurationOptions != null && internalConfigurationOptions.length != 0) { invokerConfiguration = systemProperty("pax.exam.invoker").value( internalConfigurationOptions[0].getInvoker()); } return invokerConfiguration; }