@ConfigValidator public void checkValid() { checkNotNullAndNotEmpty(this.url, "url"); checkNotNullAndNotEmpty(this.driverClassName, "driverClassName"); }
private Object applyConverterFunction(String propertyName, HandlerConfigPropertyImpl configProperty, String propertyValue) throws ConfigBuilderException { Object result = configProperty.getValueConverter().convertToTargetType(propertyValue, configProperty.getJavaType()); if ( result == null) { throw new ConfigBuilderException("Property " + propertyName + " converter function returned null when converting value " + propertyValue); } return result; }
@ConfigValidator public void validate() { if (host == null) throw new ConfigValidatorException("host property must be set"); if (port < 0) throw new ConfigValidatorException("port must be set and > 0"); if (connectionAttempts < 0) throw new ConfigValidatorException("connectionAttempts must be set and > 0"); if (connectionAttemptMillis < 0) throw new ConfigValidatorException("connectionAttemptMillis must be set and > 0"); }
@ConfigProperty( name="scope", description="Whether the database connection is closed at the end of the scenario or at the end of the feature." + " This will be set automatically to FEATURE for connections established during 'Feature-Start:' if not provided, otherwise Scenario", defaultValue = "SCENARIO" ) public void setScope(Scope scope) { this.scope = scope; }
private Pattern compilePattern(ConfigProperty p) throws ConfigBuilderException { Pattern pattern; try { pattern = Pattern.compile(p.validationPattern()); } catch (PatternSyntaxException e) { throw new ConfigBuilderException("The validation pattern '" + p.validationPattern() + "' could not be compiled, for " + getAnnotationDescription(p)); } return pattern; }
private Object convertDefaultValue(ConfigProperty p, ConfigBuilderTypeConverter f, Class javaType) throws ConfigBuilderException { return f.convertToTargetType(p.defaultValue(), javaType); }
@ConfigProperty( name= DEBUG_PORT_PROPERTY, description="Enable the debugger when starting the jvm and set it up to listen for connections on the port specified (java processes only), -1 to disable", validationPattern = "(-?)\\d+", defaultValue = "-1" ) public void setDebugPort(int debugPort) { this.debugPort = debugPort; }
@ConfigValidator public void checkValid() { if ( getPort() == 0) { throw new ConfigValidatorException("port cannot be 0"); } else if ( getStepTimeoutSeconds() < 1) { throw new ConfigValidatorException("stepTimeoutSeconds was less than 1"); } else if ( getScope() == null) { throw new ConfigValidatorException("scope was not set"); } else if ( getClientConnectTimeoutSeconds() < 1) { throw new ConfigValidatorException("client connect timeout seconds cannot be < 1"); } }
@ConfigProperty( name= SCOPE_PROPERTY, description="Whether the process should be shut down at the end of the scenario or the end of the feature." + " this will be set automatically to FEATURE for processes started during 'Feature-Start:' if not provided, otherwise Scenario", defaultValue = "SCENARIO", mandatory = false ) public void setProcessScope(Scope processScope) { this.processScope = processScope; }
@ConfigProperty( name = "stepTimeoutSeconds", description = "How long the Chorus interpreter should wait for a result after executing a step on a web socket client before failing the step", defaultValue = "60", validationPattern = "\\d+" ) public void setStepTimeoutSeconds(int stepTimeoutSeconds) { this.stepTimeoutSeconds = stepTimeoutSeconds; }
@ConfigProperty( name="scope", description="Whether the remoting connection is closed at the end of the scenario or at the end of the feature. " + "This will be set automatically to FEATURE for connections established during 'Feature-Start:' if not provided, otherwise Scenario", defaultValue = "SCENARIO" ) public void setScope(Scope scope) { this.scope = scope; }
@ConfigProperty( name = "chromeDriver.arguments", description = "Arguments to pass to the chrome browser if using CHROME driver type", mandatory = false ) public void setChromeArgs(String chromeArgs) { this.chromeArgs = chromeArgs; }
@ConfigProperty( name = "charProperty", description = "charProperty" ) public void setCharProperty(Character charProperty) { this.charProperty = charProperty; }
@ConfigProperty( name = "intProperty", description = "intProperty" ) public void setIntProperty(int intProperty) { this.intProperty = intProperty; }
@ConfigProperty( name = "floatProperty", description = "floatProperty" ) public void setFloatProperty(float floatProperty) { this.floatProperty = floatProperty; }
@ConfigProperty( name = "shortProperty", description = "shortProperty" ) public void setShortProperty(short shortProperty) { this.shortProperty = shortProperty; } }
@ConfigProperty( name = "myProperty", description = "My Property Description" ) public void setMyProperty(String goodArgument) {} }
@ConfigProperty( name = "myProperty", description = "My Property Description", mandatory = false ) public void setMyProperty(String goodArgument) {} }
@ConfigProperty( name = "shortProperty", description = "Short Property", defaultValue = "9" ) public void setShortProperty(Short f) {}
@ConfigProperty( name = "prop", description = "Property" ) public void setMyProperty(int myPrimitiveInt) {} }