Package org.rhq.core.util

Examples of org.rhq.core.util.PropertiesFileUpdate.update()


    private void testSysProps(File propsFile1, File propsFile2, File jbossHome, CommandLineProducer commandLine)
        throws Exception {
        PropertiesFileUpdate propsFile1Updater = new PropertiesFileUpdate(propsFile1.getPath());
        propsFile1Updater.update("prop1", "delta");
        propsFile1Updater.update("prop4", "epsilon");

        PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
        propsFile2Updater.update("prop2", "zeta");
        propsFile2Updater.update("prop5", "eta");
View Full Code Here


        PropertiesFileUpdate propsFile1Updater = new PropertiesFileUpdate(propsFile1.getPath());
        propsFile1Updater.update("prop1", "delta");
        propsFile1Updater.update("prop4", "epsilon");

        PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
        propsFile2Updater.update("prop2", "zeta");
        propsFile2Updater.update("prop5", "eta");

        Map<String, String> sysprops = commandLine.get().getSystemProperties();

        Assert.assertNotNull(sysprops);
View Full Code Here

        propsFile1Updater.update("prop1", "delta");
        propsFile1Updater.update("prop4", "epsilon");

        PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
        propsFile2Updater.update("prop2", "zeta");
        propsFile2Updater.update("prop5", "eta");

        Map<String, String> sysprops = commandLine.get().getSystemProperties();

        Assert.assertNotNull(sysprops);
        Assert.assertEquals(sysprops.size(), 8);
View Full Code Here

        String heapDumpDir = useForwardSlash(newConfig.getSimpleValue("heapDumpDir"));
        if (!StringUtil.isEmpty(heapDumpDir)) {
            properties.setProperty("heap_dump_dir", heapDumpDir);
        }

        propertiesUpdater.update(properties);
    }

    private void updateCassandraYaml(Configuration newConfig) {
        ConfigEditor editor = new ConfigEditor(cassandraYamlFile);
        try {
View Full Code Here

        String heapDumpDir = useForwardSlash(config.getSimpleValue("heapDumpDir"));
        if (!StringUtil.isEmpty(heapDumpDir)) {
            properties.setProperty("set.heap_dump_dir", "-XX:HeapDumpPath=" + heapDumpDir);
        }

        propertiesUpdater.update(properties);
    }

    private void validateHeapArg(String name, String value) {
        if (value.length() < 2) {
            throw new IllegalArgumentException(value + " is not a legal value for the property [" + name + "]");
View Full Code Here

        String jvmOpts = properties.getProperty("JVM_OPTS");
        jvmOpts = jvmOpts.substring(0, jvmOpts.lastIndexOf("\""));
        jvmOpts = jvmOpts + " -Dcassandra.ring_delay_ms=2000\"";
        properties.setProperty("JVM_OPTS", jvmOpts);

        propertiesUpdater.update(properties);

        File binDir = new File(deploymentOptions.getBasedir(), "bin");
        SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();

        ProcessExecution processExecution = getProcessExecution(binDir);
View Full Code Here

            File runJar = null;
            try {
                propsFile1 = File.createTempFile("jboss1-", ".properties");

                PropertiesFileUpdate propsFile1Updater = new PropertiesFileUpdate(propsFile1.getPath());
                propsFile1Updater.update("prop1", "delta");
                propsFile1Updater.update("prop4", "epsilon");

                propsFile2 = File.createTempFile("jboss2-", ".properties");
                PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
                propsFile2Updater.update("prop2", "zeta");
View Full Code Here

            try {
                propsFile1 = File.createTempFile("jboss1-", ".properties");

                PropertiesFileUpdate propsFile1Updater = new PropertiesFileUpdate(propsFile1.getPath());
                propsFile1Updater.update("prop1", "delta");
                propsFile1Updater.update("prop4", "epsilon");

                propsFile2 = File.createTempFile("jboss2-", ".properties");
                PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
                propsFile2Updater.update("prop2", "zeta");
                propsFile2Updater.update("prop5", "eta");
View Full Code Here

                propsFile1Updater.update("prop1", "delta");
                propsFile1Updater.update("prop4", "epsilon");

                propsFile2 = File.createTempFile("jboss2-", ".properties");
                PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
                propsFile2Updater.update("prop2", "zeta");
                propsFile2Updater.update("prop5", "eta");
            } catch (IOException e) {
                Assert.fail();
            }
View Full Code Here

                propsFile1Updater.update("prop4", "epsilon");

                propsFile2 = File.createTempFile("jboss2-", ".properties");
                PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
                propsFile2Updater.update("prop2", "zeta");
                propsFile2Updater.update("prop5", "eta");
            } catch (IOException e) {
                Assert.fail();
            }

            return new String[] { //
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.