Posts

  • Test CLI UI in Java

    Most applications have web or Swing UI or just plain simple REST or SOAP interfaces. Mostly you’ll write unit tests but sometimes you’ll also need some integrations tests or even simple smoke tests. You can easily create such tests for application using different tools like Selenium for web, FEST for Swing or JMeter, SoapUI, REST Assured for REST/SOAP API test scenarios. There are tons of tools and you can use whatever you want. But what to do when you have CLI UI and you only use STD IN and OUT ?

  • Java through the rabbit hole: synchronized method vs block

    Lately I was wondering what’s the difference between synchronized method and block in Java. Assuming you’re using sync block monitor on this they work exactly the same. So what’s the difference ? Let’s check what’s beneath the hood.

  • Interview questions about dictionary

    When you go to interviews sometimes you’ll get some strange question about data structures. Most commonly it’s something about dictionary. Sometimes it’s ‘how you would implement dictionary’, sometimes it’s ‘find two words in dictionary’ or even ‘check if word is concatenation of words from dictionary’. If you think dictionary should be array/list then you’re screwed. So let’s fix some knowledge gaps.

  • Dude, where is my currying or why java cannot make it right ?

    Currying is great. If you want to make oh so pretty functions with clear calls it’s the way to go. So why Big O when adding Java lambdas couldn’t make call to functional interfaces seamless but called explicitly ? Let me give you example of what I mean.

  • Variables and dependencies version management in gradle microservices

    In work I develop project in microservice architecture. It’s really great. I’m responsible for only few services and some common libs. As always there’s small, tiny, micro ‘but’. Here’s what happened. One week we moved our nexus to different address and I’ve had to change all links in gradle build files. As we work with standard GitHub dev flow it took some time to finish (all PRs, reviews, etc.). Next week we decided to upgrade our libs and frameworks to newest versions. Again it took some time to finish because most services use Dropwizard and same libs. Another week passed and I made changes to our common lib and needed to release new version of it. Guess what ? Yep, I needed to change version in all gradle build files. I was quite pissed and said enough is enough and came up with idea to solve this goddamnedexhaustingtakingtoolongshitty problem. Here’s how I did it.

  • Postgres COPY in java

    The fastest way do add latge quantity of data to postgres in to use COPY. Well you can also read from postgres using COPY, but that’s for some other time. Getting back to topic there’s implementation of COPY in java’s postgresql driver which I’ll show you how to use.

subscribe via RSS