1 18 19 package org.apache.jmeter.protocol.java.config; 20 21 import java.io.Serializable ; 22 23 import org.apache.jmeter.config.Arguments; 24 import org.apache.jmeter.config.ConfigTestElement; 25 import org.apache.jmeter.protocol.java.sampler.JavaSampler; 26 import org.apache.jmeter.testelement.property.TestElementProperty; 27 28 38 public class JavaConfig extends ConfigTestElement implements Serializable 39 { 40 41 44 public JavaConfig() 45 { 46 setArguments(new Arguments()); 47 } 48 49 57 public void setClassname(String classname) 58 { 59 setProperty(JavaSampler.CLASSNAME, classname); 60 } 61 62 70 public String getClassname() 71 { 72 return getPropertyAsString(JavaSampler.CLASSNAME); 73 } 74 75 84 public void addArgument(String name, String value) 85 { 86 Arguments args = this.getArguments(); 87 args.addArgument(name, value); 88 } 89 90 93 public void removeArguments() 94 { 95 setProperty( 96 new TestElementProperty(JavaSampler.ARGUMENTS, new Arguments())); 97 } 98 99 108 public void setArguments(Arguments args) 109 { 110 setProperty(new TestElementProperty(JavaSampler.ARGUMENTS, args)); 111 } 112 113 121 public Arguments getArguments() 122 { 123 return (Arguments) getProperty(JavaSampler.ARGUMENTS).getObjectValue(); 124 } 125 } 126 | Popular Tags |