Skip to content

Commit

Permalink
Update the failing suggested model test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunayf committed Sep 29, 2024
1 parent 243f763 commit 6ff5eb2
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public void test(Path config) throws IOException {
if (!categories.equals(testConfig.categories())) {
TestConfig updateConfig = new TestConfig(testConfig.description(), testConfig.position(),
testConfig.source(), categories);
updateConfig(config, updateConfig);
// updateConfig(config, updateConfig);
compareJsonElements(categories, testConfig.categories());
Assert.fail(String.format("Failed test: '%s' (%s)", testConfig.description(), configJsonPath));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void test(Path config) throws IOException {
if (!prefix.equals(testConfig.prefix()) || !suffix.equals(testConfig.suffix())) {
TestConfig updateConfig = new TestConfig(testConfig.description(), testConfig.position(),
testConfig.source(), prefix, suffix);
updateConfig(config, updateConfig);
// updateConfig(config, updateConfig);
Assert.fail(String.format("Failed test: '%s' (%s)", testConfig.description(), configJsonPath));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public void test(Path config) throws IOException {
JsonArray categories = availableNodes.getAsJsonArray();
if (!categories.equals(testConfig.categories())) {
TestConfig updateConfig = new TestConfig(testConfig.description(), testConfig.keyword(), categories);
updateConfig(config, updateConfig);
// updateConfig(config, updateConfig);
compareJsonElements(categories, testConfig.categories());
Assert.fail(String.format("Failed test: '%s' (%s)", testConfig.description(), configJsonPath));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void test(Path config) throws IOException {
new TestConfig(testConfig.description(), testConfig.source(), testConfig.position(),
testConfig.queryMap(), categories);
// updateConfig(configJsonPath, updateConfig);
compareJsonElements(categories, testConfig.categories());
Assert.fail(String.format("Failed test: '%s' (%s)", testConfig.description(), configJsonPath));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void test(Path config) throws IOException {
new TestConfig(testConfig.source(), testConfig.position(), testConfig.description(),
testConfig.codedata(), nodeTemplate);
// updateConfig(configJsonPath, updateConfig);
compareJsonElements(nodeTemplate, testConfig.output());
Assert.fail(String.format("Failed test: '%s' (%s)", testConfig.description(), configJsonPath));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void test(Path config) throws IOException {
deleteFolder(project.toFile());
if (!resp.getAsJsonObject("service").equals(testConfig.lineRange())) {
TestConfig updatedConfig = new TestConfig(testConfig.contractFile(), resp.get("service").getAsJsonObject());
updateConfig(configJsonPath, updatedConfig);
// updateConfig(configJsonPath, updatedConfig);
Assert.fail(String.format("Failed test: '%s'", configJsonPath));
}
TestUtil.shutdownLanguageServer(endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
{
"id": "32875",
"metadata": {
"label": "New Variable",
"description": "New variable 'i' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -168,11 +168,11 @@
{
"id": "34762",
"metadata": {
"label": "Update Variable",
"description": "Update the value of the variable 'i'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "UPDATE_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand All @@ -191,7 +191,7 @@
"expression": {
"metadata": {
"label": "Expression",
"description": "Update variable"
"description": "Expression"
},
"valueType": "EXPRESSION",
"value": "i + 3",
Expand Down Expand Up @@ -220,11 +220,11 @@
{
"id": "36858",
"metadata": {
"label": "New Variable",
"description": "New variable 'val' with type 'string'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
{
"id": "32875",
"metadata": {
"label": "New Variable",
"description": "New variable 'i' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -113,11 +113,11 @@
{
"id": "34874",
"metadata": {
"label": "New Variable",
"description": "New variable 'val' with type 'string'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -225,11 +225,11 @@
{
"id": "35754",
"metadata": {
"label": "Update Variable",
"description": "Update the value of the variable 'i'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "UPDATE_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand All @@ -248,7 +248,7 @@
"expression": {
"metadata": {
"label": "Expression",
"description": "Update variable"
"description": "Expression"
},
"valueType": "EXPRESSION",
"value": "i + 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@
{
"id": "33775",
"metadata": {
"label": "New Variable",
"description": "New variable 'j' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -168,11 +168,11 @@
{
"id": "34784",
"metadata": {
"label": "New Variable",
"description": "New variable 'val' with type 'string'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -230,11 +230,11 @@
{
"id": "35883",
"metadata": {
"label": "New Variable",
"description": "New variable 'i' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -287,11 +287,11 @@
{
"id": "37850",
"metadata": {
"label": "New Variable",
"description": "New variable 'val' with type 'string'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
{
"id": "38827",
"metadata": {
"label": "New Variable",
"description": "New variable 'x' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -113,11 +113,11 @@
{
"id": "39819",
"metadata": {
"label": "New Variable",
"description": "New variable 'y' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
{
"id": "38827",
"metadata": {
"label": "New Variable",
"description": "New variable 'x' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -113,11 +113,11 @@
{
"id": "39819",
"metadata": {
"label": "New Variable",
"description": "New variable 'y' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
{
"id": "38827",
"metadata": {
"label": "New Variable",
"description": "New variable 'x' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -113,11 +113,11 @@
{
"id": "39819",
"metadata": {
"label": "New Variable",
"description": "New variable 'y' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -170,11 +170,11 @@
{
"id": "40782",
"metadata": {
"label": "New Variable",
"description": "New variable 'z' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
{
"id": "38827",
"metadata": {
"label": "New Variable",
"description": "New variable 'x' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -113,11 +113,11 @@
{
"id": "39819",
"metadata": {
"label": "New Variable",
"description": "New variable 'y' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down Expand Up @@ -170,11 +170,11 @@
{
"id": "40782",
"metadata": {
"label": "New Variable",
"description": "New variable 'z' with type 'int'"
"label": "Assign",
"description": "Assign a value to a variable"
},
"codedata": {
"node": "NEW_DATA",
"node": "ASSIGN",
"lineRange": {
"fileName": "if.bal",
"startLine": {
Expand Down

0 comments on commit 6ff5eb2

Please sign in to comment.