本文整理汇总了Java中org.apache.jmeter.testbeans.TestBean类的典型用法代码示例。如果您正苦于以下问题:Java TestBean类的具体用法?Java TestBean怎么用?Java TestBean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestBean类属于org.apache.jmeter.testbeans包,在下文中一共展示了TestBean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: suiteBeanComponents
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
private static Test suiteBeanComponents() throws Exception {
TestSuite suite = new TestSuite("BeanComponents");
Iterator<Object> iter = getObjects(TestBean.class).iterator();
while (iter.hasNext()) {
Class<? extends Object> c = iter.next().getClass();
try {
JMeterGUIComponent item = new TestBeanGUI(c);
// JMeterGUIComponent item = (JMeterGUIComponent) iter.next();
TestSuite ts = new TestSuite(item.getClass().getName());
ts.addTest(new JMeterTest("GUIComponents2", item));
ts.addTest(new JMeterTest("runGUITitle", item));
suite.addTest(ts);
} catch (IllegalArgumentException e) {
System.out.println("o.a.j.junit.JMeterTest Cannot create test for " + c.getName() + " " + e);
e.printStackTrace(System.out);
}
}
return suite;
}
示例2: AbstractCqlSamplerBeanInfo
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
protected AbstractCqlSamplerBeanInfo(Class<? extends TestBean> beanClass) {
super(beanClass);
createPropertyGroup("cql", new String[] { "clusterId", "keySpace", "consistency", "query" });
PropertyDescriptor p = property("query", TypeEditor.TextAreaEditor);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "select * from Standard");
p.setValue(TEXT_LANGUAGE, "sql");
p = property("keySpace");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "stress");
p = property("clusterId");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "Cluster1");
p = property("consistency");
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, CassandraClusterConfigBeanInfo.toStrings(ConsistencyLevel.values()));
}
示例3: notifyTestListenersOfStart
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
private void notifyTestListenersOfStart(SearchByClass<TestStateListener> testListeners) {
for (TestStateListener tl : testListeners.getSearchResults()) {
if (tl instanceof TestBean) {
TestBeanHelper.prepare((TestElement) tl);
}
if (host == null) {
tl.testStarted();
} else {
tl.testStarted(host);
}
}
}
示例4: getIcon
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
public ImageIcon getIcon(boolean enabled) {
try {
if (getTestElement() instanceof TestBean) {
try {
Image img = Introspector.getBeanInfo(
getTestElement().getClass()).getIcon(
BeanInfo.ICON_COLOR_16x16);
// If icon has not been defined, then use GUI_CLASS property
if (img == null) {//
Object clazz = Introspector.getBeanInfo(
getTestElement().getClass())
.getBeanDescriptor().getValue(
TestElement.GUI_CLASS);
if (clazz == null) {
log.error("Can't obtain GUI class for "
+ getTestElement().getClass().getName());
return null;
}
return GUIFactory.getIcon(
Class.forName((String) clazz), enabled);
}
return new ImageIcon(img);
} catch (IntrospectionException e1) {
log.error("Can't obtain icon", e1);
throw new org.apache.jorphan.util.JMeterError(e1);
}
} else {
return GUIFactory.getIcon(Class.forName(getTestElement()
.getPropertyAsString(TestElement.GUI_CLASS)), enabled);
}
} catch (ClassNotFoundException e) {
log.warn("Can't get icon for class " + getTestElement(), e);
return null;
}
}
示例5: notifyTestListenersOfStart
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
@SuppressWarnings("deprecation") // Deliberate use of deprecated method
private void notifyTestListenersOfStart(SearchByClass<TestStateListener> testListeners) {
for (TestStateListener tl : testListeners.getSearchResults()) {
if (tl instanceof TestBean) {
TestBeanHelper.prepare((TestElement) tl);
}
if (host == null) {
tl.testStarted();
} else {
tl.testStarted(host);
}
}
}
示例6: BeanShellBeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
protected BeanShellBeanInfoSupport(Class<? extends TestBean> beanClass) {
super(beanClass);
PropertyDescriptor p;
p = property("resetInterpreter");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.FALSE);
p.setValue(NOT_EXPRESSION, Boolean.TRUE);
p.setValue(NOT_OTHER, Boolean.TRUE);
createPropertyGroup("resetGroup", new String[] { "resetInterpreter" });
p = property("parameters");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
createPropertyGroup("parameterGroup", new String[] { "parameters" });
p = property("filename");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
createPropertyGroup("filenameGroup", new String[] { "filename" });
p = property("script");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p.setPropertyEditorClass(TextAreaEditor.class);
createPropertyGroup("scripting", new String[] { "script" });
}
示例7: getIcon
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
public ImageIcon getIcon(boolean enabled) {
TestElement testElement = getTestElement();
try {
if (testElement instanceof TestBean) {
Class<?> testClass = testElement.getClass();
try {
Image img = Introspector.getBeanInfo(testClass).getIcon(BeanInfo.ICON_COLOR_16x16);
// If icon has not been defined, then use GUI_CLASS property
if (img == null) {
Object clazz = Introspector.getBeanInfo(testClass).getBeanDescriptor()
.getValue(TestElement.GUI_CLASS);
if (clazz == null) {
log.warn("getIcon(): Can't obtain GUI class from " + testClass.getName());
return null;
}
return GUIFactory.getIcon(Class.forName((String) clazz), enabled);
}
return new ImageIcon(img);
} catch (IntrospectionException e1) {
log.error("Can't obtain icon for class "+testElement, e1);
throw new org.apache.jorphan.util.JMeterError(e1);
}
}
return GUIFactory.getIcon(Class.forName(testElement.getPropertyAsString(TestElement.GUI_CLASS)),
enabled);
} catch (ClassNotFoundException e) {
log.warn("Can't get icon for class " + testElement, e);
return null;
}
}
示例8: prepareBean
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
protected void prepareBean() {
if (wrapped instanceof TestBean) {
//noinspection deprecation
TestBeanHelper.prepare((TestElement) wrapped); // the deprecation reason is not sufficient
}
}
示例9: JSR223BeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
protected JSR223BeanInfoSupport(Class<? extends TestBean> beanClass) {
super(beanClass, LANGUAGE_TAGS, NAME_BUNDLE);
}
示例10: BeanShellBeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
protected BeanShellBeanInfoSupport(Class<? extends TestBean> beanClass) {
super(beanClass);
}
示例11: BSFBeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
protected BSFBeanInfoSupport(Class<? extends TestBean> beanClass) {
super(beanClass, LANGUAGE_TAGS);
}
示例12: ScriptingBeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
public ScriptingBeanInfoSupport(Class<? extends TestBean> beanClass, String[] languageTags) {
this(beanClass, languageTags, null);
}
示例13: JDBCTestElementBeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
/**
* @param beanClass class to create bean info for
*/
public JDBCTestElementBeanInfoSupport(Class<? extends TestBean> beanClass) {
super(beanClass);
// createPropertyGroup("varName", // $NON-NLS-1$
// new String[]{"dataSource" }); // $NON-NLS-1$
//
// createPropertyGroup("sql", // $NON-NLS-1$
// new String[] {
// "queryType", // $NON-NLS-1$
// "query", // $NON-NLS-1$
// "queryArguments", // $NON-NLS-1$
// "queryArgumentsTypes", // $NON-NLS-1$
// "variableNames", // $NON-NLS-1$
// "resultVariable", // $NON-NLS-1$
// "queryTimeout", // $NON-NLS-1$
// "resultSetHandler" // $NON-NLS-1$
// });
//
// PropertyDescriptor p = property("dataSource"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, ""); // $NON-NLS-1$
//
// p = property("queryArguments"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, ""); // $NON-NLS-1$
//
// p = property("queryArgumentsTypes"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, ""); // $NON-NLS-1$
//
// p = property("variableNames"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, ""); // $NON-NLS-1$
//
// p = property("resultSetHandler"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, AbstractJDBCTestElement.RS_STORE_AS_STRING);
// p.setValue(NOT_OTHER, Boolean.TRUE);
// p.setValue(TAGS,new String[]{
// AbstractJDBCTestElement.RS_STORE_AS_STRING,
// AbstractJDBCTestElement.RS_STORE_AS_OBJECT,
// AbstractJDBCTestElement.RS_COUNT_RECORDS
// });
//
// p = property("resultVariable"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, ""); // $NON-NLS-1$
//
// p = property("queryTimeout"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, "");
//
// p = property("queryType"); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, AbstractJDBCTestElement.SELECT);
// p.setValue(NOT_OTHER,Boolean.TRUE);
// p.setValue(TAGS,new String[]{
// AbstractJDBCTestElement.SELECT,
// AbstractJDBCTestElement.UPDATE,
// AbstractJDBCTestElement.CALLABLE,
// AbstractJDBCTestElement.PREPARED_SELECT,
// AbstractJDBCTestElement.PREPARED_UPDATE,
// AbstractJDBCTestElement.COMMIT,
// AbstractJDBCTestElement.ROLLBACK,
// AbstractJDBCTestElement.AUTOCOMMIT_FALSE,
// AbstractJDBCTestElement.AUTOCOMMIT_TRUE,
// });
//
// p = property("query", TypeEditor.TextAreaEditor); // $NON-NLS-1$
// p.setValue(NOT_UNDEFINED, Boolean.TRUE);
// p.setValue(DEFAULT, ""); // $NON-NLS-1$
// p.setValue(TEXT_LANGUAGE, "sql"); // $NON-NLS-1$
}
示例14: CassandraTestElementBeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
/**
*
*/
public CassandraTestElementBeanInfoSupport(Class<? extends TestBean> beanClass) {
super(beanClass);
createPropertyGroup("varName", // $NON-NLS-1$
new String[]{"sessionName" }); // $NON-NLS-1$
createPropertyGroup("cql", // $NON-NLS-1$
new String[] {
"queryType", // $NON-NLS-1$
"query", // $NON-NLS-1$
"queryArguments", // $NON-NLS-1$
"variableNames", // $NON-NLS-1$
"resultVariable", // $NON-NLS-1$
"consistencyLevel", // $NON-NLS-1$
"batchSize" // $NON-NLS-1$
});
PropertyDescriptor p = property("sessionName"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("queryArguments"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("variableNames"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("resultVariable"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("batchSize"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("queryType"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, AbstractCassandaTestElement.SIMPLE);
p.setValue(NOT_OTHER,Boolean.TRUE);
p.setValue(TAGS,new String[]{
AbstractCassandaTestElement.SIMPLE,
AbstractCassandaTestElement.PREPARED,
AbstractCassandaTestElement.DYNAMIC_BATCH
});
p = property("consistencyLevel"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "ONE");
p.setValue(NOT_OTHER,Boolean.TRUE);
p.setValue(TAGS,new String[]{
AbstractCassandaTestElement.ANY,
AbstractCassandaTestElement.ONE,
AbstractCassandaTestElement.QUORUM,
AbstractCassandaTestElement.TWO,
AbstractCassandaTestElement.THREE,
AbstractCassandaTestElement.ALL,
AbstractCassandaTestElement.LOCAL_ONE,
AbstractCassandaTestElement.LOCAL_QUORUM,
AbstractCassandaTestElement.EACH_QUORUM
});
p = property("query", TypeEditor.TextAreaEditor); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p.setValue(TEXT_LANGUAGE, "sql"); // $NON-NLS-1$
}
示例15: JDBCTestElementBeanInfoSupport
import org.apache.jmeter.testbeans.TestBean; //导入依赖的package包/类
/**
*
*/
public JDBCTestElementBeanInfoSupport(Class<? extends TestBean> beanClass) {
super(beanClass);
createPropertyGroup("varName", // $NON-NLS-1$
new String[]{"dataSource" }); // $NON-NLS-1$
createPropertyGroup("sql", // $NON-NLS-1$
new String[] {
"queryType", // $NON-NLS-1$
"query", // $NON-NLS-1$
"queryArguments", // $NON-NLS-1$
"queryArgumentsTypes", // $NON-NLS-1$
"variableNames", // $NON-NLS-1$
"resultVariable", // $NON-NLS-1$
"queryTimeout" // $NON-NLS-1$
});
PropertyDescriptor p = property("dataSource"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("queryArguments"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("queryArgumentsTypes"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("variableNames"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("resultVariable"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p = property("queryTimeout"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("queryType"); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, AbstractJDBCTestElement.SELECT);
p.setValue(NOT_OTHER,Boolean.TRUE);
p.setValue(TAGS,new String[]{
AbstractJDBCTestElement.SELECT,
AbstractJDBCTestElement.UPDATE,
AbstractJDBCTestElement.CALLABLE,
AbstractJDBCTestElement.PREPARED_SELECT,
AbstractJDBCTestElement.PREPARED_UPDATE,
AbstractJDBCTestElement.COMMIT,
AbstractJDBCTestElement.ROLLBACK,
AbstractJDBCTestElement.AUTOCOMMIT_FALSE,
AbstractJDBCTestElement.AUTOCOMMIT_TRUE,
});
p = property("query", TypeEditor.TextAreaEditor); // $NON-NLS-1$
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, ""); // $NON-NLS-1$
p.setValue(TEXT_LANGUAGE, "sql"); // $NON-NLS-1$
}