Skip to content

Conversation

@zutshiy
Copy link
Contributor

@zutshiy zutshiy commented Mar 24, 2019

Adding new PR for the master branch instead of develop-v5.

Refer :
#1588

Updated the changes with new name for the field and code changes compatible with Java 7.

Also updated the JSONFormatter constructor to include a TimeUtils object for getting the timestamp in string ISO format. This also helps make the timeStamp field testable using mocks.

We can rename the TimeUtils class name to something more generic (as a utility class for the JSONFormatter) for future updates if more util methods are added which need to be mocked for the jsonformatter tests.

Please let me know if any more changes are needed.

New timeStampMillis field added to the eventBus as well as the TimeService (and its stub).

This calcualtes the system time elapsed in millis and is later used in the jsonformatter as a time stamp (after conversion).

This field can be used in all the events for timestamp usages if required (unlike nanos this is an accurate representation of the current timestamp), right now its only being used in TestCaseStarted.

I also updated the JUnits accordinly since the date is calculated dynamically. The JSON formatter takes a DateTimeFormatter input to change how the time will be formatted to string format.
@coveralls
Copy link

coveralls commented Mar 24, 2019

Coverage Status

Coverage increased (+0.003%) to 86.443% when pulling 5fb5227 on gazler22:feature/json-report-timestamp-master into 6d4b5bb on cucumber:master.

@mpkorstanje
Copy link
Contributor

Almost there!

@bischoffdev
Copy link
Contributor

I am seriously excited about this :-)

zutshiy added 2 commits March 25, 2019 21:47
Updated some Test classes to also include an eventBus with the stubbed TimeService.

Updated new json strings for test cases to reflect the timeStampMillis generated from threadlocal.

Removed TimeUtils.java
@mpkorstanje mpkorstanje changed the title Adding new timeStampMillis field to event and json reports [Core] Add timestamp milis to TestCaseStartedEvent and json reporter Mar 28, 2019
@mpkorstanje mpkorstanje merged commit 6698a38 into cucumber:master Mar 28, 2019
@mpkorstanje
Copy link
Contributor

Cheers!

@zutshiy zutshiy deleted the feature/json-report-timestamp-master branch March 29, 2019 03:49
@lock
Copy link

lock bot commented Mar 28, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants