Comment by Jonathan on How to unit test java multiple thread
@stalet Yep, failed assertions or waiter.resume() calls will interrupt the awaiting main thread immediately. If a failure occurred, it will be re-thrown automatically allowing the test to fail as...
View ArticleComment by Jonathan on Retry Task Framework
More specifically, if you use, and want a dependency on, Spring Batch.
View ArticleComment by Jonathan on RabbitMQ - surviving a consumer disconnection using...
@JohnSmith Last I checked, only connection errors trigger recovery. Also rabbitmq.com/api-guide.html#cache-pitfalls
View ArticleComment by Jonathan on Async test wihout Thread.sleep
Two tools that might be helpful - Awaitility and ConcurrentUnit.
View ArticleComment by Jonathan on Junit, testing timer.schedule without relying on...
If you need to perform assertions from a Timer or ExecutorService thread, check out ConcurrentUnit.
View ArticleComment by Jonathan on Using Modelmapper, how do I map to a class with no...
You can also use a Provider to instantiate your destination class.
View ArticleComment by Jonathan on How to convert hex string to Java string?
Lots of substrings being created. Not ideal.
View ArticleComment by Jonathan on Styling for option values in a HTML select drop-down...
No luck on OSX with Chrome.
View ArticleComment by Jonathan on Intellij IDEA Java classes not auto compiling on save
Getting used to something that one IDE does for me and another does not, making my life more difficult, is not a good selling point.
View ArticleComment by Jonathan on How can I set highlight quote key color in yaml in...
@once I noticed the same thing as you - that vs code sees quoted keys as quoted strings rather than keys. Did you end up finding a solution?
View ArticleComment by Jonathan on Singleton pattern with Go generics
The problem of course is that the part of some code where a singleton is needed, such as in a separate library, isn't aware of the concrete value of T.
View ArticleComment by Jonathan on Singleton pattern with Go generics
Thanks for sharing this. Unfortunately it doesn't get around the problem posed above, where the singleton stored globally doesn't know what type argument might be supplied to it elsewhere. In your...
View ArticleAnswer by Jonathan for cannot select Parameterized Type
You can only learn the value of I and R by capturing them in a subclass definition - otherwise they are erased at runtime. Ex:class MyStringRestHelper extends RestHelper<String, String> {Then...
View ArticleAnswer by Jonathan for junit assert in thread throws exception
Where multiple worker threads are concerned, such as in the original question, simply joining one of them is not sufficient. Ideally, you'll want to wait for all worker threads to complete while still...
View ArticleAnswer by Jonathan for How do I write a JUnit test case to test threads and...
This is what I created ConcurrentUnit for. The general usage is:Spawn some threadsHave the main thread wait or sleepPerform assertions from within the worker threads (which via ConcurrentUnit, are...
View ArticleAnswer by Jonathan for Automapper for Java
Check out my ModelMapper. It was inspired by AutoMapper, but adds a few new things such as intelligent mapping.ModelMapper is an intelligent objectmapping framework that eliminates theneed to manually...
View ArticleAnswer by Jonathan for any tool for java object to object mapping?
My ModelMapper is another library worth checking out. ModelMapper's design is different from other libraries in that it:Automatically maps object models by intelligently matching source and destination...
View ArticleAnswer by Jonathan for DTO and mapper generation from Domain Objects
Consider checking out my ModelMapper.It differs from Dozer and others in that it minimizes the amount of configuration needed by intelligently mapping object models. Where configuration is needed,...
View ArticleAnswer by Jonathan for Framework for converting java objects
You might check out my ModelMapper.It differs from Dozer and others in that it minimizes the amount of configuration needed by intelligently mapping object models. Where configuration is needed,...
View ArticleAnswer by Jonathan for How to map POJO in to DTO, if fields are with...
My ModelMapper is another library worth checking out. It offers a fluent API to map properties as opposed to using string references or XML.Check out the ModelMapper site for more...
View Article