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

Better JUnit integration #7

Open
danielfernandez opened this issue Jan 23, 2014 · 4 comments
Open

Better JUnit integration #7

danielfernandez opened this issue Jan 23, 2014 · 4 comments

Comments

@danielfernandez
Copy link
Member

Enhance integration with JUnit in order to allow each thymeleaf test (.thtest) to be counted by JUnit as a separated test, so that execution summary figures better reflect the real amount of executed tests.

@ultraq
Copy link
Member

ultraq commented Jan 23, 2014

This would be awesome to have IMO. Have you seen what I've been doing to make each test file equate to a single JUnit test? https://github.com/ultraq/thymeleaf-layout-dialect/blob/master/Tests/nz/net/ultraq/thymeleaf/tests/decorator/DecoratorTester.java And that's just 1 of about 4 files like it. Soooo much boilerplate!

@Kleeven81
Copy link

This would help us a lot too! Especially since we are using the testing framework to test over 500 templates used in our applications.

@ultraq
Copy link
Member

ultraq commented Jun 7, 2014

I finally got tired of the boilerplate involved with hooking up a new thtest file w/ JUnit, so I went looking for a way to dynamically generate a test for every Thymeleaf test file, and stumbled across JUnit's Parameterized tests feature. I ended-up creating this class (JUnitThymeleafTestExecutor.java) to replace all the other ones I had that just mapped Thymeleaf tests to JUnit tests.

It's not exactly the same as it was before (tests are still reported on separately, but aren't grouped by package any more as they're all effectively run by this single class), but maybe it's a good starting point for this issue? I'm just glad I don't have to write any more @Test-annotated methods, just Thymeleaf test files! :)

@opensource21
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants