Package com.eviware.x.form

Examples of com.eviware.x.form.XFormDialog


    public void perform(WsdlInterface target, Object param) {
        generateTestSuite(target, false);
    }

    public WsdlTestSuite generateTestSuite(WsdlInterface iface, boolean atCreation) {
        XFormDialog dialog = ADialogBuilder.buildDialog(GenerateForm.class);
        dialog.setValue(GenerateForm.STYLE, "One TestCase for each Operation");
        dialog.setValue(GenerateForm.REQUEST_CONTENT, "Create new empty requests");
        String[] names = ModelSupport.getNames(iface.getOperationList());
        dialog.setOptions(GenerateForm.OPERATIONS, names);
        XFormOptionsField operationsFormField = (XFormOptionsField) dialog.getFormField(GenerateForm.OPERATIONS);
        operationsFormField.setSelectedOptions(names);

        WsdlProject project = iface.getProject();
        String[] testSuites = ModelSupport.getNames(new String[]{"<create>"}, project.getTestSuiteList());
        dialog.setOptions(GenerateForm.TESTSUITE, testSuites);

        if (dialog.show()) {
            List<String> operations = StringUtils.toStringList(operationsFormField.getSelectedOptions());
            if (operations.size() == 0) {
                UISupport.showErrorMessage("No Operations selected..");
                return null;
            }

            String testSuiteName = dialog.getValue(GenerateForm.TESTSUITE);

            if (testSuiteName.equals("<create>")) {
                testSuiteName = UISupport.prompt("Enter name of TestSuite to create", "Generate TestSuite",
                        iface.getName() + " TestSuite");
            }

            if (testSuiteName != null && testSuiteName.trim().length() > 0) {
                WsdlTestSuite testSuite = project.getTestSuiteByName(testSuiteName);

                if (testSuite == null) {
                    testSuite = project.addNewTestSuite(testSuiteName);
                }

                int style = dialog.getValueIndex(GenerateForm.STYLE);
                boolean useExistingRequests = dialog.getValueIndex(GenerateForm.REQUEST_CONTENT) == 0;
                boolean generateLoadTest = dialog.getBooleanValue(GenerateForm.GENERATE_LOADTEST);
                if (style == 0) {
                    generateMulipleTestCases(testSuite, iface, useExistingRequests, generateLoadTest, operations);
                } else if (style == 1) {
                    generateSingleTestCase(testSuite, iface, useExistingRequests, generateLoadTest, operations);
                }
View Full Code Here


    }


    @Override
    public void perform(RestMockService mockService, Object param) {
        XFormDialog dialog = ADialogBuilder.buildDialog(Form.class);
        dialog.setOptions(Form.HTTP_METHOD, RestRequestInterface.HttpMethod.getMethodsAsStringArray());
        dialog.setValue(Form.HTTP_METHOD, RestRequestInterface.HttpMethod.GET.name());

        JTextFieldFormField formField = (JTextFieldFormField) dialog.getFormField(Form.RESOURCE_PATH);
        formField.getComponent().requestFocus();

        while (dialog.show()) {
            String resourcePath = dialog.getValue(Form.RESOURCE_PATH);
            String httpMethod = dialog.getValue(Form.HTTP_METHOD);

            if (StringUtils.hasContent(resourcePath)) {
                mockService.addEmptyMockAction(RestRequestInterface.HttpMethod.valueOf(httpMethod), resourcePath);
                break;
            }
View Full Code Here

        super("Add JMS endpoint", "Wizard for creating JMS endpoint");
    }

    public void perform(AbstractInterface<?> iface, Object param) {

        XFormDialog dialog = buildDialog(iface);

        initValues(iface);

        if (dialog.show()) {
            String session = dialog.getValue(SESSION);
            int i = dialog.getValueIndex(SEND);
            if (i == -1) {
                UISupport.showErrorMessage("Not supported endpoint");
                return;
            }
            String send = destinationNameList.get(i).getDestinationName();
            int j = dialog.getValueIndex(RECEIVE);
            if (j == -1) {
                UISupport.showErrorMessage("Not supported endpoint");
                return;
            }
            String receive = destinationNameList.get(j).getDestinationName();
View Full Code Here

        toolHost.run(new ProcessToolRunner(builder, "SoapUI TestRunner", modelItem, args));
    }

    protected ArgumentBuilder buildArgs(WsdlProject modelItem) throws IOException {
        XFormDialog dialog = getDialog();
        if (dialog == null) {
            ArgumentBuilder builder = new ArgumentBuilder(new StringToStringMap());
            builder.startScript("testrunner", ".bat", ".sh");
            return builder;
        }

        StringToStringMap values = dialog.getValues();

        ArgumentBuilder builder = new ArgumentBuilder(values);

        builder.startScript("testrunner", ".bat", ".sh");

        builder.addString(ENDPOINT, "-e", "");
        builder.addString(HOSTPORT, "-h", "");

        if (!values.get(TESTSUITE).equals(ALL_VALUE)) {
            builder.addString(TESTSUITE, "-s", "");
        }

        if (!values.get(TESTCASE).equals(ALL_VALUE)) {
            builder.addString(TESTCASE, "-c", "");
        }

        builder.addString(USERNAME, "-u", "");
        builder.addStringShadow(PASSWORD, "-p", "");
        builder.addString(DOMAIN, "-d", "");
        builder.addString(WSSTYPE, "-w", "");

        builder.addBoolean(PRINTREPORT, "-r");
        builder.addBoolean(EXPORTALL, "-a");
        builder.addBoolean(EXPORTJUNITRESULTS, "-j");
        builder.addString(ROOTFOLDER, "-f", "");

        if (proVersion) {
            builder.addBoolean(OPEN_REPORT, "-o");
            builder.addBoolean(COVERAGE, "-g");
            builder.addString(GENERATEREPORTSEACHTESTCASE, "-R", "");
            builder.addString(REPORTFORMAT, "-F", "");
            builder.addString(ENVIRONMENT, "-E", "");
        }

        builder.addStringShadow(PROJECTPASSWORD, "-x", "");
        builder.addStringShadow(SOAPUISETTINGSPASSWORD, "-v", "");
        builder.addBoolean(IGNOREERRORS, "-I");
        builder.addBoolean(SAVEAFTER, "-S");

        addPropertyArguments(builder);

        if (dialog.getBooleanValue(ADDSETTINGS)) {
            try {
                builder.addBoolean(ADDSETTINGS, "-t" + SoapUI.saveSettings());
            } catch (Exception e) {
                SoapUI.logError(e);
            }
View Full Code Here

        builder.start();
        closeDialog(modelItem);
    }

    private ArgumentBuilder buildArgs(WsdlInterface modelItem) throws IOException {
        XFormDialog dialog = getDialog();
        if (dialog == null) {
            ArgumentBuilder builder = new ArgumentBuilder(new StringToStringMap());
            builder.startScript("tcpmon", ".bat", ".sh");
            return builder;
        }

        StringToStringMap values = dialog.getValues();

        ArgumentBuilder builder = new ArgumentBuilder(values);
        builder.startScript("tcpmon", ".bat", ".sh");

        builder.addArgs(values.get(PORT));
View Full Code Here

        toolHost.run(new ProcessToolRunner(builder, "SoapUI Security TestRunner", modelItem, args));
    }

    private ArgumentBuilder buildArgs(WsdlProject modelItem) throws IOException {
        XFormDialog dialog = getDialog();
        if (dialog == null) {
            ArgumentBuilder builder = new ArgumentBuilder(new StringToStringMap());
            builder.startScript(SECURITYTESTRUNNER, BAT, SH);
            return builder;
        }

        StringToStringMap values = dialog.getValues();

        ArgumentBuilder builder = new ArgumentBuilder(values);

        builder.startScript(SECURITYTESTRUNNER, BAT, SH);
View Full Code Here

    private JButton refreshAccessTokenButton;

    public OAuth2AdvancedOptionsDialog(OAuth2Profile profile, JButton refreshAccessTokenButton) {
        this.refreshAccessTokenButton = refreshAccessTokenButton;
        expirationTimeComponent = new ExpirationTimeChooser(profile);
        XFormDialog dialog = ADialogBuilder.buildDialog(Form.class);

        dialog.getFormField(Form.ACCESS_TOKEN_EXPIRATION_TIME).setProperty("component", expirationTimeComponent);

        setAccessTokenOptions(profile, dialog);

        setRefreshAccessTokenOptions(profile, dialog);

        if (dialog.show()) {
            String accessTokenPosition = dialog.getValue(Form.ACCESS_TOKEN_POSITION);
            profile.setAccessTokenPosition(AccessTokenPosition.valueOf(accessTokenPosition));

            String refreshAccessTokenMethod = dialog.getValue(Form.AUTOMATIC_ACCESS_TOKEN_REFRESH);
            profile.setRefreshAccessTokenMethod(OAuth2Profile.RefreshAccessTokenMethods.valueOf(refreshAccessTokenMethod.toUpperCase()));

            String manualExpirationTime = expirationTimeComponent.getAccessTokenExpirationTime();
            TimeUnitConfig.Enum expirationTimeUnit = expirationTimeComponent.getAccessTokenExpirationTimeUnit();
            profile.setManualAccessTokenExpirationTime(manualExpirationTime);
View Full Code Here

        buildAndShowDialog();
    }

    private void buildAndShowDialog() {
        FormLayout layout = new FormLayout("5px,100px,5px,left:default,5px:grow(1.0)");
        final XFormDialog dialog = ADialogBuilder.buildDialog(AuthorizationTypeForm.class, null, layout);

        profileNameField = (JTextFieldFormField) dialog.getFormField(AuthorizationTypeForm.OAUTH2_PROFILE_NAME_FIELD);
        profileNameField.addFormFieldListener(new ProfileNameFieldListener(dialog));

        hintTextLabel = (JLabelFormField) dialog.getFormField(AuthorizationTypeForm.OAUTH2_PROFILE_NAME_HINT_TEXT_LABEL);
        setHintTextColor();

        setProfileNameAndHintTextVisibility(request.getAuthType());

        List<String> authTypes = getBasicAuthenticationTypes();
        authTypes.removeAll(request.getBasicAuthenticationProfiles());
        if (request instanceof RestRequest) {
            authTypes.add(CredentialsConfig.AuthType.O_AUTH_2_0.toString());

            int nextProfileIndex = getOAuth2ProfileContainer().getOAuth2ProfileList().size() + 1;
            profileNameField.setValue("Profile " + nextProfileIndex);
        }

        setAuthTypeComboBoxOptions(dialog, authTypes);

        dialog.setValue(AuthorizationTypeForm.AUTHORIZATION_TYPE, request.getAuthType());
        if (dialog.show()) {
            createProfileForSelectedAuthType(dialog);
        }
    }
View Full Code Here

TOP

Related Classes of com.eviware.x.form.XFormDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.