All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lazerycode.jmeter.configuration.JMeterProcessJVMSettings Maven / Gradle / Ivy

There is a newer version: 3.8.0
Show newest version
package com.lazerycode.jmeter.configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * Used to specify JVM settings for the JMeter instance that will be run
 * 

* Configuration in pom.xml: *

*

 * {@code
 * 	
 *      
 *          ${env.JAVA_HOME}/bin/java
 *          512
 *          1024
 *          
 *              foo
 *          
 *      
 *  
 * }
 * 
* * @author Mark Collin */ @SuppressWarnings({"UnusedDeclaration", "FieldCanBeLocal"}) public class JMeterProcessJVMSettings { private int xms = 512; private int xmx = 512; private String javaRuntime = "java"; private List arguments = new ArrayList<>(); private static final String RUN_HEADLESS = "-Djava.awt.headless=true"; private static final String HEADLESS_SETTING = "-Djava.awt.headless="; public JMeterProcessJVMSettings() { super(); } public int getXms() { return xms; } public int getXmx() { return xmx; } public List getArguments() { return arguments; } public JMeterProcessJVMSettings addArgument(String newArgument) { if (arguments.stream().noneMatch(argument -> argument.equals(newArgument))) { arguments.add(newArgument); } return this; } public JMeterProcessJVMSettings setHeadlessDefaultIfRequired() { if (arguments.stream().noneMatch(argument -> argument.contains(HEADLESS_SETTING))) { addArgument(RUN_HEADLESS); } return this; } public String getJavaRuntime() { return this.javaRuntime; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy