public void setValue(final InstallData installData, final String value) { installData.setVariable(key, value); }
public void setValue(final InstallData installData, final String value) { installData.setVariable(key, value); }
public UserInputPanelConsole(Resources resources, ConsolePanels panels) { super(resources, panels); } public boolean runConsoleFromProperties(InstallData installData, Properties properties){ boolean result = super.runConsoleFromProperties(installData, properties); for (Map.Entry<Object, Object> entry : properties.entrySet()) { if (properties.containsKey(entry.getKey())) { String value = (String) entry.getValue(); if(!StringsUtil.isEmptyString(value)){ installData.setVariable(entry.getKey().toString(), value); } } } return result; }
@Override public boolean run(InstallData installData, Properties properties) { for (ConsoleField field : fields) { String name = field.getVariable(); if (name != null) { String value = properties.getProperty(name); if (value != null) { installData.setVariable(name, value); } } } return true; }
/** * Sets the variable value. * * @param value the variable value. May be {@code null} */ public void setValue(String value) { unprocessedValue = value; if (saving) { value = process(value); } if (logger.isLoggable(Level.FINE)) { logger.fine("Field setting variable=" + variable + " to value=" + value); } installData.setVariable(variable, value); saving = false; }
/** * MUST always be called in constructor of JDKPathConsolePanel and JDKPathPanel * @param installData */ public static void initialize(InstallData installData) { minVersion = installData.getVariable("JDKPathPanel.minVersion"); maxVersion = installData.getVariable("JDKPathPanel.maxVersion"); installData.setVariable(JDK_VAR_NAME, JDK_PATH); }
/** * Check if JDK panel should be skipped. * Return true if panel should be skipped otherwise false. * * @param installData * @param path * @return */ public static boolean skipPanel(InstallData installData, String path) { String skipIfValid = installData.getVariable("JDKPathPanel.skipIfValid"); if (pathIsValid(path) && skipIfValid != null && ("yes".equalsIgnoreCase(skipIfValid) || "true".equalsIgnoreCase(skipIfValid))) { installData.setVariable(JDK_PATH, path); return true; } return false; } }
/** * Creates the temporary directory and sets the install data variable to point to it * * @throws IOException if creation of the directory fails */ public void create() throws IOException { try { tempdir = File.createTempFile(tempDirDescription.getPrefix(), tempDirDescription.getSuffix()); tempdir.delete(); tempdir.mkdir(); } catch (IOException e) { logger.log(Level.SEVERE, "Unable to create temporary directory for installation: " + e.getMessage(), e); throw e; } installData.setVariable(tempDirDescription.getVariableName(), tempdir.getAbsolutePath()); housekeeper.registerForCleanup(this); }
installData.setVariable(newVariable, value);
for (Object key : variables.keySet()) installData.setVariable((String) key, (String) variables.get(key));
/** * {@inheritDoc} */ @Override public void runAutomated(InstallData installData, IXMLElement panelRoot) { if (registered) { try { registryHelper.updateUninstallName(); } catch (NativeLibException ex) { logger.log(Level.SEVERE, ex.getMessage(), ex); } } installData.setVariable("UNINSTALL_NAME", registryHelper.getUninstallName()); }
@Test void configuresGmail() { final InstallData data = mock(InstallData.class); when(data.getVariable(eq(Variables.EMAIL_CONFIGURATION_TYPE.getKey()))).thenReturn("gmail.com"); final DataValidator validator = new SimpleEmailServerValidator(); validator.validateData(data); // will fail, but that's OK here; we only care about the configuration aspect verify(data).setVariable(eq(Variables.IS_EMAIL_ENABLED.getKey()), eq("true")); verify(data).setVariable(eq(Variables.SMTP_AUTH.getKey()), eq("true")); verify(data).setVariable(eq(Variables.SMTP_IS_SSL.getKey()), eq("true")); verify(data).setVariable(eq(Variables.SMTP_IS_TLS.getKey()), eq("false")); verify(data).setVariable(eq(Variables.SMTP_PORT.getKey()), eq("465")); verify(data).setVariable(eq(Variables.SMTP_HOSTNAME.getKey()), eq("smtp.gmail.com")); }
@Test void configuresSeznam() { final InstallData data = mock(InstallData.class); when(data.getVariable(eq(Variables.EMAIL_CONFIGURATION_TYPE.getKey()))).thenReturn("seznam.cz"); final DataValidator validator = new SimpleEmailServerValidator(); validator.validateData(data); // will fail, but that's OK here; we only care about the configuration aspect verify(data).setVariable(eq(Variables.IS_EMAIL_ENABLED.getKey()), eq("true")); verify(data).setVariable(eq(Variables.SMTP_AUTH.getKey()), eq("true")); verify(data).setVariable(eq(Variables.SMTP_IS_SSL.getKey()), eq("true")); verify(data).setVariable(eq(Variables.SMTP_IS_TLS.getKey()), eq("false")); verify(data).setVariable(eq(Variables.SMTP_PORT.getKey()), eq("465")); verify(data).setVariable(eq(Variables.SMTP_HOSTNAME.getKey()), eq("smtp.seznam.cz")); }
@Override public void runAutomated(InstallData installData, IXMLElement panelRoot) throws InstallerException { IXMLElement jdkPathElement = panelRoot.getFirstChildNamed("jdkPath"); String jdkPath = jdkPathElement.getContent(); IXMLElement jdkVarNameElement = panelRoot.getFirstChildNamed("jdkVarName"); String jdkVarName = jdkVarNameElement.getContent(); installData.setVariable(jdkVarName, jdkPath); }
@Override public void runAutomated(InstallData idata, IXMLElement panelRoot) { // We set the installation path IXMLElement ipath = panelRoot.getFirstChildNamed(UserPathPanel.pathElementName); // Allow for variable substitution of the installpath value if (ipath != null) { String path = ipath.getContent(); path = idata.getVariables().replace(path); idata.setVariable(UserPathPanel.pathVariableName, path); } }
@Test void storeValue() { for (final Variables variable : Variables.values()) { final String key = variable.getKey(); final String value = UUID.randomUUID().toString(); final InstallData data = mock(InstallData.class); variable.setValue(data, value); verify(data).setVariable(key, value); } } }
if (backupVariable != null) installData.setVariable(backupVariable, processor.getOriginalValue()); installData.setVariable(toVariable, processorResult); processorResult = processor.getOriginalValue();
idata.setVariable(variable, value); blockedVariablesList.add(variable);
installData.setVariable("UNINSTALL_NAME", registryHelper.getUninstallName()); if (result)
installData.setVariable(JDKPathPanelHelper.JDK_PATH, strPath);