Skip to content

Conversation

@TobiasNx
Copy link
Contributor

@TobiasNx TobiasNx commented Nov 15, 2024

@fsteeg could you help me with the test? the objectSleeper?

@fsteeg
Copy link
Member

fsteeg commented Nov 19, 2024

You should first fix the compiler and build errors (missing imports, wrong file / class name, missing variables, formatting).

Conceptually, the idea looks good, though you will have to call process at some point to actually run the workflow, and instead of the if-statement, you should use something like assertTrue(timeElapsed >= sleepTime) to verify the result. But to compare them like this, they have to be numbers (instead of Instant), e.g. from System.nanoTime().

As expressed by my approval in #495, I think it would be fine to go without a test here, if you don't want to dig into this.

@fsteeg fsteeg assigned TobiasNx and unassigned fsteeg Nov 19, 2024
@fsteeg fsteeg removed their request for review November 19, 2024 12:03
@TobiasNx
Copy link
Contributor Author

@fsteeg I tried to improve as much as I can. Not sure how to fix the last errors when compiling.

@fsteeg
Copy link
Member

fsteeg commented Nov 27, 2024

Cool, pretty close! I changed sleepTimer.objectSleeper to objectSleeper.process(null) to make it compile, and changed the time to 100 ms to make the test work (and to fail if the sleeper does not wait). Also added a type parameter to ObjectSleeper (<String>) to fix compiler warnings and did some cleanup.

@TobiasNx TobiasNx merged commit 8081fb5 into 495-objectSleep Nov 27, 2024
1 check passed
@TobiasNx TobiasNx deleted the 495-testDrarft branch November 27, 2024 16:57
@dr0i dr0i changed the title 495-testDrarft Add object sleeper Jan 13, 2025
@dr0i dr0i changed the title Add object sleeper Add test for object sleeper Jan 13, 2025
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.

3 participants