當前位置: 首頁>>代碼示例>>Java>>正文


Java TestBeanGUI類代碼示例

本文整理匯總了Java中org.apache.jmeter.testbeans.gui.TestBeanGUI的典型用法代碼示例。如果您正苦於以下問題:Java TestBeanGUI類的具體用法?Java TestBeanGUI怎麽用?Java TestBeanGUI使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TestBeanGUI類屬於org.apache.jmeter.testbeans.gui包,在下文中一共展示了TestBeanGUI類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTestElement

import org.apache.jmeter.testbeans.gui.TestBeanGUI; //導入依賴的package包/類
public TestElement getTestElement() {
    Preconditions.checkNotNull(name);
    Preconditions.checkNotNull(fileName);

    CSVDataSet csvDataSet = new CSVDataSet();
    csvDataSet.setProperty(TestElement.GUI_CLASS, TestBeanGUI.class.getName());
    csvDataSet.setProperty(TestElement.TEST_CLASS, CSVDataSet.class.getName());
    csvDataSet.setName(name);
    csvDataSet.setEnabled(true);

    // calling the setters doesn't work in jmeter 2.11
    csvDataSet.setProperty("filename", getOptionalValue(fileName, String.format("%s%s", outputFilePath, fileName.toString())));
    csvDataSet.setProperty("fileEncoding", fileEncoding);
    csvDataSet.setProperty("variableNames", variableNames);
    csvDataSet.setProperty("delimiter",delimiter);
    csvDataSet.setProperty("quotedData", quotedData);
    csvDataSet.setProperty("recycle", recycle);
    csvDataSet.setProperty("stopThread", stopThread);
    csvDataSet.setProperty("shareMode", shareMode);

    return csvDataSet;
}
 
開發者ID:lithiumtech,項目名稱:mineraloil-jmeter,代碼行數:23,代碼來源:CSVDataSetElement.java

示例2: suiteGUIComponents

import org.apache.jmeter.testbeans.gui.TestBeanGUI; //導入依賴的package包/類
private static Test suiteGUIComponents() throws Exception {
    TestSuite suite = new TestSuite("GuiComponents");
    Iterator<Object> iter = getObjects(JMeterGUIComponent.class).iterator();
    while (iter.hasNext()) {
        JMeterGUIComponent item = (JMeterGUIComponent) iter.next();
        if (item instanceof JMeterTreeNode) {
            System.out.println("o.a.j.junit.JMeterTest INFO: JMeterGUIComponent: skipping all tests  " + item.getClass().getName());
            continue;
        }
        if (item instanceof ObsoleteGui){
            continue;
        }
        TestSuite ts = new TestSuite(item.getClass().getName());
        ts.addTest(new JMeterTest("GUIComponents1", item));
        if (item instanceof TestBeanGUI) {
            System.out.println("o.a.j.junit.JMeterTest INFO: JMeterGUIComponent: skipping some tests " + item.getClass().getName());
        } else {
            ts.addTest(new JMeterTest("GUIComponents2", item));
            ts.addTest(new JMeterTest("runGUITitle", item));
        }
        suite.addTest(ts);
    }
    return suite;
}
 
開發者ID:botelhojp,項目名稱:apache-jmeter-2.10,代碼行數:25,代碼來源:JMeterTest.java

示例3: suiteBeanComponents

import org.apache.jmeter.testbeans.gui.TestBeanGUI; //導入依賴的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;
}
 
開發者ID:botelhojp,項目名稱:apache-jmeter-2.10,代碼行數:20,代碼來源:JMeterTest.java

示例4: getTestElement

import org.apache.jmeter.testbeans.gui.TestBeanGUI; //導入依賴的package包/類
public TestElement getTestElement() {
    ConstantThroughputTimer timer = new ConstantThroughputTimer();
    timer.setProperty(TestElement.GUI_CLASS, TestBeanGUI.class.getName());
    timer.setProperty(TestElement.TEST_CLASS, ConstantThroughputTimer.class.getName());
    timer.setName("Constant Throughput Timer");
    timer.setComment("Used to throttle the amount of activity in any given minute to simulate real user loads");
    timer.setEnabled(true);

    // calling the setters doesn't work in jmeter 2.11
    timer.setProperty("throughput", throughput);
    timer.setProperty("calcMode", calcMode.getIndex());

    return timer;
}
 
開發者ID:lithiumtech,項目名稱:mineraloil-jmeter,代碼行數:15,代碼來源:ConstantThroughputTimerElement.java

示例5: actionPerformed

import org.apache.jmeter.testbeans.gui.TestBeanGUI; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent actionEvent) {

    //Get class from input text field
    String className = this.textField.getText();

    //Get list of class properties
    List<FieldExpressionMapping> attributeList = new ArrayList<>();
    try {

        //Load class and get fields using reflection
        Class loadedClass = Class.forName(className);

        Field fields[] = loadedClass.getDeclaredFields();

        for (Field field : fields) {

            field.setAccessible(true);

            FieldExpressionMapping expressionMapping = new FieldExpressionMapping();
            expressionMapping.setFieldName(field.getName());
            expressionMapping.setFieldExpression(PropsKeys.IGNORE);

            attributeList.add(expressionMapping);
        }

        //Get current test GUI component
        TestBeanGUI testBeanGUI = (TestBeanGUI) GuiPackage.getInstance().getCurrentGui();
        Field customizer = TestBeanGUI.class.getDeclaredField(PropsKeys.CUSTOMIZER);
        customizer.setAccessible(true);


        //From TestBeanGUI retrieve Bean Customizer as it includes all editors like ClassPropertyEditor, TableEditor
        GenericTestBeanCustomizer testBeanCustomizer = (GenericTestBeanCustomizer) customizer.get(testBeanGUI);
        Field editors = GenericTestBeanCustomizer.class.getDeclaredField(PropsKeys.EDITORS);
        editors.setAccessible(true);

        //Retrieve TableEditor and set all fields with default values to it
        PropertyEditor propertyEditors[] = (PropertyEditor[]) editors.get(testBeanCustomizer);
        for (PropertyEditor propertyEditor : propertyEditors){
            if (propertyEditor instanceof TableEditor){
                propertyEditor.setValue(attributeList);
            }
        }

    } catch (NoSuchFieldException | IllegalAccessException | ClassNotFoundException e) {
        JOptionPane.showMessageDialog(null, "Failed to load class properties : " + e.getMessage(), "ERROR: Failed to load class properties!" , JOptionPane.ERROR_MESSAGE);
        LOGGER.log(Level.SEVERE, "Failed to load class properties", e);
    }

}
 
開發者ID:GSLabDev,項目名稱:pepper-box,代碼行數:52,代碼來源:ClassPropertyEditor.java


注:本文中的org.apache.jmeter.testbeans.gui.TestBeanGUI類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。