Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#289] Flag to tag timeouts as permanent failure #290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[#289] Flag to tag timeouts as permanent failure #290

wants to merge 1 commit into from

Conversation

yevgenys
Copy link

refactored SMSCShellExecutor:removed duplicates for CLI get command;
added new option to CLI get command;
added tests for CLI get command;
added new flag 'markTimeoutAsPermanentFailure' to SmscPropertiesManagement;
added functionality for new flag;
Fixes #289

reduced code in ShellExecutor;
added discovery of new getters via reflection:
no need to add manual call of getter method, getter will be discovered automatically

    private void initSmscPropertiesManagementGetters() {
        smscPropertiesManagementGetters = new HashMap<>();
        Class c = smscPropertiesManagement.getClass();
        for (Method method : c.getMethods()) {
            String methodName = method.getName();
            if (methodName.startsWith("get")) {
                smscPropertiesManagementGetters.put(methodName.substring(3).toLowerCase(), method);
            } else if (methodName.startsWith("is")) {
                smscPropertiesManagementGetters.put(methodName.substring(2).toLowerCase(), method);
            }
        }
    }

then just call function
addProperty(sb, "${getterNameWithout_get|is}");

…mmand;

added new option to CLI get command;
added tests for CLI get command;
added new flag 'markTimeoutAsPermanentFailure' to SmscPropertiesManagement;
added functionality for new flag;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant