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

[IDEA Plugin] Test Implementation - Milestone #1 #9639

Merged
merged 34 commits into from
Aug 2, 2018

Conversation

NipunaRanasinghe
Copy link
Contributor

Purpose

This PR provides test implementation related to

  • Lexer
  • Parsing
  • Formatting

//This flag is used to include/filter BBE testerina files for the formatting testing
boolean includeTests = false;
Path path = Paths.get(getTestDataPath());
doTestBBEDirectory(path, includeTests);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the unnecessary variable includeTests since it is always true.

Copy link
Contributor Author

@NipunaRanasinghe NipunaRanasinghe Jul 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Member

@Shan1024 Shan1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comments inline.

*/
public class BallerinaLexerTest extends LexerTestCase {

private final String testDataPath = "../../composer/modules/integration-tests/src/test/resources/ballerina"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final variables should be capitalized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

if (!path.toFile().exists()) {
throw new FileNotFoundException(path.toString());
}
doTestDirectory(path, includeTests);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary variable includeTests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

return "src/test/resources/testData/formatting/BBE";
}

//this test validates the formatting for the ballerina-by-examples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize the first letter and add a space after that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where exactly you have done this?

File resource = path.toFile();
if (resource.exists()) {
if (resource.isFile() && resource.getName().endsWith(myFileExt)) {
doTest(resource, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the 2nd parameter since it is always true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -0,0 +1,6 @@
#To run this sample, navigate to the directory that contains the
Copy link
Member

@Shan1024 Shan1024 Jul 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the file

@@ -0,0 +1,6 @@
#To run this sample, navigate to the directory that contains the
Copy link
Member

@Shan1024 Shan1024 Jul 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the file

@Shan1024 Shan1024 merged commit b9290e8 into ballerina-platform:master Aug 2, 2018
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.

2 participants