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

Add builder for Timeout rule. Make Timeout rule designed for extension. #986

Merged
merged 3 commits into from
Sep 14, 2014

Conversation

kcooney
Copy link
Member

@kcooney kcooney commented Sep 7, 2014

No description provided.

@kcooney kcooney force-pushed the Timeout-rule-builder branch 2 times, most recently from 1896b77 to 216b881 Compare September 7, 2014 00:57
@kcooney kcooney added this to the 4.12 milestone Sep 7, 2014
}

/**
* @param millis the timeout in milliseconds
* Creates a {@link Timeout} that will timeout a test after the
* given duratoin, in milliseconds.
Copy link
Member

Choose a reason for hiding this comment

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

typo

@marcphilipp
Copy link
Member

Is there a use case for extending Timeout?

@kcooney
Copy link
Member Author

kcooney commented Sep 10, 2014

Some of the pull requests for Timeout that haven't been progressing could be solved by allowing developers to subclass Timeout and using the Builder pattern seemed like a good way to go

@kcooney kcooney force-pushed the Timeout-rule-builder branch 2 times, most recently from ffdcdff to dd5140b Compare September 10, 2014 16:37
@marcphilipp
Copy link
Member

@kcooney
Copy link
Member Author

kcooney commented Sep 13, 2014

@marcphilipp I updated the release notes. PTAL.

If it looks good, I'll squash the commits.

@Rule public final TestRule timeout = Timeout.builder()
.withTimeout(10, TimeUnit.SECONDS)
.withLookingForStuckThread(true)
.build()
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Missing a ; here.

@marcphilipp
Copy link
Member

LGTM besides the missing semicolon. :-)

@kcooney kcooney force-pushed the Timeout-rule-builder branch from db82674 to 65d08cc Compare September 14, 2014 17:37
@kcooney kcooney force-pushed the Timeout-rule-builder branch from 65d08cc to 510d807 Compare September 14, 2014 17:39
@kcooney
Copy link
Member Author

kcooney commented Sep 14, 2014

Good catch! Thanks. Rebased. Waiting on Travis to build, then feel free to merge.

marcphilipp added a commit that referenced this pull request Sep 14, 2014
Add builder for Timeout rule. Make Timeout rule designed for extension.
@marcphilipp marcphilipp merged commit 3d7dfb3 into junit-team:master Sep 14, 2014
@marcphilipp
Copy link
Member

Thanks!

@kcooney kcooney deleted the Timeout-rule-builder branch January 4, 2015 20:00
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