1 18 19 package org.apache.jmeter.ejb.jndi.control; 20 21 import java.io.Serializable ; 22 import java.util.Collection ; 23 import java.util.HashSet ; 24 import java.util.LinkedList ; 25 import java.util.Set ; 26 27 import org.apache.jmeter.control.AbstractGenerativeController; 28 import org.apache.jmeter.ejb.jndi.config.JndiConfig; 29 import org.apache.jmeter.ejb.jndi.config.LookupConfig; 30 import org.apache.jmeter.ejb.jndi.config.MethodConfig; 31 import org.apache.jmeter.ejb.jndi.control.gui.JndiTestSampleGui; 32 import org.apache.jmeter.ejb.jndi.sampler.JNDISampler; 33 import org.apache.jmeter.samplers.Entry; 34 import org.apache.jmeter.util.JMeterUtils; 35 import org.apache.log4j.Category; 36 43 public class JndiTestSample extends AbstractGenerativeController 44 implements Serializable 45 { 46 private static Category catClass = Category.getInstance( 47 JndiTestSample.class.getName()); 48 49 protected JndiConfig defaultJndiConfig; 50 51 protected static Set addableList; 52 53 public JndiTestSample() 54 { 55 defaultJndiConfig = new JndiConfig(); 56 } 57 58 public JndiConfig getDefaultJndiConfig() 59 { 60 return defaultJndiConfig; 61 } 62 63 public void setDefaultJndiConfig(JndiConfig config) 64 { 65 defaultJndiConfig = config; 66 } 67 68 public void uncompile() 69 { 70 super.uncompile(); 71 } 72 73 public String getClassLabel() 74 { 75 return JMeterUtils.getResString("jndi_testing_title"); 76 } 77 78 public Class getGuiClass() 79 { 80 return org.apache.jmeter.ejb.jndi.control.gui.JndiTestSampleGui.class; 81 } 82 83 public Class getTagHandlerClass() 84 { 85 return org.apache.jmeter.ejb.jndi.save.JndiTestSampleHandler.class; 86 } 87 88 94 public Collection getAddList() 95 { 96 if(addableList == null) 97 { 98 addableList = new HashSet (); 99 addableList.add(new LookupConfig().getClassLabel()); 100 addableList.add(new MethodConfig().getClassLabel()); 101 } 102 return addableList; 103 } 104 105 public Object clone() 106 { 107 catClass.info("Start : clone1"); 108 JndiTestSample control = new JndiTestSample(); 109 control.setDefaultJndiConfig(defaultJndiConfig); 110 this.standardCloneProc(control); 111 catClass.info("End : clone1"); 112 return control; 113 } 114 115 protected Entry createEntry() 116 { 117 catClass.info("Start : createEntry1"); 118 Entry entry = new Entry(); 119 entry.setSamplerClass(JNDISampler.class); 120 entry.addConfigElement(defaultJndiConfig); 121 catClass.info("End : createEntry1"); 122 return entry; 123 } 124 } 125 | Popular Tags |