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

Extracting out unrelated logic from TestNG class. #1596

Conversation

krmahadevan
Copy link
Member

  • Moved some of the parsing logic to the Parser class.
  • Moved some of the zip file parsing logic to its
    own class.
  • Added a test jar to support tests for Zip file
    extraction logic.

Fixes # .

Did you remember to?

  • Add test case(s)
  • Update CHANGES.txt

We encourage pull requests that:

  • Add new features to TestNG (or)
  • Fix bugs in TestNG

If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.

* Moved some of the parsing logic to the Parser class.
* Moved some of the zip file parsing logic to its
own class.
* Added a test jar to support tests for Zip file
extraction logic.
Copy link
Member

@juherr juherr left a comment

Choose a reason for hiding this comment

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

Awesome change 👍

suites.add(XmlSuiteUtils.newXmlSuiteUsing(classes));
}
} catch (IOException ex) {
ex.printStackTrace();
Copy link
Member

Choose a reason for hiding this comment

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

Maybe throw an TestNGException

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

}
suites.add(suiteToAdd);
}
foundTestngXml = true;
Copy link
Member

Choose a reason for hiding this comment

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

you can return directly

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

import static org.assertj.core.api.Assertions.assertThat;

public class JarFileUtilsTest {
private static final File jar = new File("src/test/resources/testng-tests.jar");
Copy link
Member

Choose a reason for hiding this comment

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

Note for later: the jar should/could be generated by the test (for example with https://github.com/shrinkwrap/shrinkwrap)

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a TODO

@juherr juherr requested a review from cbeust November 7, 2017 09:03
Copy link
Collaborator

@cbeust cbeust left a comment

Choose a reason for hiding this comment

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

LGTM.

@krmahadevan krmahadevan merged commit c0b72cf into testng-team:master Nov 8, 2017
@krmahadevan
Copy link
Member Author

@cbeust - Thanks for approving the PR. Since I remember you had mentioned earlier, that I can go ahead and merge, if its been approved by you, I fixed the comments from @juherr and then merged it.

@krmahadevan krmahadevan deleted the krmahadevan-extract-jar-processing-logic-out branch November 8, 2017 03:36
@cbeust
Copy link
Collaborator

cbeust commented Nov 8, 2017

Yup, go right ahead @krmahadevan. I noticed @juherr hadn't looked yet so I didn't want to merge it just yet but it looked good to me.

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.

None yet

3 participants