Skip to content

Commit

Permalink
Merge branch 'master' into python3-useJython-renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
EmaMaier committed Feb 6, 2020
2 parents ce266f7 + df0674e commit b126e01
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cloudslang-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ http://www.apache.org/licenses/LICENSE-2.0
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cloudslang-api-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cloudslang-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>

<artifactId>cloudslang-cli</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cloudslang-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cloudslang-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private Input createPropInput(Map.Entry<String, Map<String, Serializable>> entry
boolean defaultSpecified = defaultKeyFound && value != null && !StringUtils.EMPTY.equals(value);

if (privateInput && required && !defaultSpecified) {
throw new RuntimeException(
throw new RuntimeException(PreCompileValidator.VALIDATION_ERROR +
"Input: '" + inputName + "' is private and required but no default value was specified");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,20 @@ public void validateBreakKeys(List<String> breakKeys) {

@Override
public void validateInputName(String name) {
validateVariableNameRules(name);
validateInOutName(name);
}

@Override
public void validateOutputName(String name) {
validateVariableNameRules(name);
validateInOutName(name);
}

private void validateInOutName(String name) {
try {
validateVariableNameRules(name);
} catch (RuntimeException e) {
throw new RuntimeException(PreCompileValidator.VALIDATION_ERROR + e.getMessage(), e);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

public interface PreCompileValidator {

String VALIDATION_ERROR = "Validation failed. ";

String validateExecutableRawData(ParsedSlang parsedSlang,
Map<String, Object> executableRawData,
List<RuntimeException> errors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,18 @@ public void validateDefaultResult(List<Result> results, String artifactName, Lis
for (int i = 0; i < results.size() - 1; i++) {
Result currentResult = results.get(i);
if (ResultUtils.isDefaultResult(currentResult)) {
errors.add(new RuntimeException(
"Flow: '" + artifactName + "' syntax is illegal. Error compiling result: '" +
errors.add(new RuntimeException(PreCompileValidator.VALIDATION_ERROR +
"Flow: '" + artifactName + "' syntax is illegal. Error compiling result: '" +
currentResult.getName() + "'. Default result should be on last position."
));
}
}
if (results.size() > 0) {
Result lastResult = results.get(results.size() - 1);
if (!ResultUtils.isDefaultResult(lastResult)) {
errors.add(new RuntimeException(
errors.add(new RuntimeException(PreCompileValidator.VALIDATION_ERROR +
"Flow: '" + artifactName + "' syntax is illegal. Error compiling result: '" +
lastResult.getName() + "'. Last result should be default result."
lastResult.getName() + "'. Last result should be default result."
));
}
}
Expand Down Expand Up @@ -578,7 +578,7 @@ private void validateInputNamesDifferentFromOutputNames(ExecutableModellingResul
private void validateNotDuplicateInOutParam(Collection<InOutParam> inOutParams, InOutParam element,
String message, List<RuntimeException> errors) {
if (SetUtils.containsIgnoreCaseBasedOnName(inOutParams, element)) {
errors.add(new RuntimeException(message));
errors.add(new RuntimeException(PreCompileValidator.VALIDATION_ERROR + message));
} else {
inOutParams.add(element);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import io.cloudslang.lang.compiler.configuration.SlangCompilerSpringConfig;
import io.cloudslang.lang.compiler.modeller.model.Executable;
import io.cloudslang.lang.compiler.validator.PreCompileValidator;
import io.cloudslang.lang.entities.ScoreLangConstants;
import io.cloudslang.lang.entities.bindings.Result;

Expand Down Expand Up @@ -67,7 +68,8 @@ public void testFlowDefaultResults() throws Exception {

@Test
public void testOpDefaultResultNotLastPosition() throws Exception {
expectMessage("Flow: 'op_2' syntax is illegal. Error compiling result: 'CUSTOM_2'." +
expectMessage(PreCompileValidator.VALIDATION_ERROR +
"Flow: 'op_2' syntax is illegal. Error compiling result: 'CUSTOM_2'." +
" Default result should be on last position.");
preCompileExecutable("/results/op_2.sl");
}
Expand Down Expand Up @@ -96,7 +98,8 @@ public void testDecisionWrongResultValueInteger() throws Exception {

@Test
public void testDecisionMultipleDefaultResults() throws Exception {
expectMessage("Flow: 'decision_1' syntax is illegal. Error compiling result: 'LESS_THAN'." +
expectMessage(PreCompileValidator.VALIDATION_ERROR +
"Flow: 'decision_1' syntax is illegal. Error compiling result: 'LESS_THAN'." +
" Default result should be on last position.");
preCompileExecutable("/results/decision_2.sl");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.cloudslang.lang.compiler.configuration.SlangCompilerSpringConfig;
import io.cloudslang.lang.compiler.modeller.result.CompilationModellingResult;
import io.cloudslang.lang.compiler.parser.utils.ParserExceptionHandler;
import io.cloudslang.lang.compiler.validator.PreCompileValidator;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
Expand Down Expand Up @@ -454,6 +455,7 @@ public void testInputPrivateAndNoDefault() throws Exception {
final Set<SlangSource> path = new HashSet<>();
exception.expect(RuntimeException.class);
exception.expectMessage("For operation 'private_input_without_default' syntax is illegal.\n" +
PreCompileValidator.VALIDATION_ERROR +
"Input: 'input_without_default' is private and required but no default value was specified");
compiler.compile(SlangSource.fromFile(resource), path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import io.cloudslang.lang.compiler.configuration.SlangCompilerSpringConfig;
import io.cloudslang.lang.compiler.modeller.result.ExecutableModellingResult;
import io.cloudslang.lang.compiler.validator.PreCompileValidator;
import io.cloudslang.lang.compiler.validator.PreCompileValidatorImpl;
import java.net.URI;
import java.util.List;
Expand Down Expand Up @@ -380,6 +381,7 @@ public void testInputPrivateAndNoDefault() throws Exception {
assertTrue(result.getErrors().size() > 0);
exception.expect(RuntimeException.class);
exception.expectMessage("For operation 'private_input_without_default' syntax is illegal.\n" +
PreCompileValidator.VALIDATION_ERROR +
"Input: 'input_without_default' is private and required but no default value was specified");
throw result.getErrors().get(0);
}
Expand Down
2 changes: 1 addition & 1 deletion cloudslang-content-maven-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cloudslang-content-verifier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>

<artifactId>cloudslang-content-verifier</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cloudslang-enforcer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cloudslang-entities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion cloudslang-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cloudslang-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cloudslang-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>cloudslang</artifactId>
<groupId>io.cloudslang.lang</groupId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<groupId>io.cloudslang.lang</groupId>
<artifactId>cloudslang</artifactId>
<version>1.0.115-SNAPSHOT</version>
<version>1.0.116-SNAPSHOT</version>
<packaging>pom</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down

0 comments on commit b126e01

Please sign in to comment.