Month: August 2014
-
Java + Groovy: Creating Immutable List
Java: Mutable List Java: Immutable List Java: Immutable List using Guava Groovy: Immutable List Read More…
-
IntelliJ: Selectively Disable Line Wrap
PROBLEM Sometimes, we have very lengthy statements that look like this:- When we reformat the code in IntelliJ, it becomes like this:- There are times we really don’t want the long statements to wrap around because they look very messy. SOLUTION While there is no option to selectively disable just the line wrap in IntelliJ,… Read More…
-
Java: Promoting Testability by Having Enum Implementing an Interface
OVERVIEW This post illustrates how we can easily write a better test case without polluting our production code with non-production code by performing a minor refactoring to the production code. PROBLEM Let’s assume we have a simple Data Reader that reads all the lines of a given algorithm data file and returns them:- This API… Read More…
-
If you spend too much time thinking about a thing…
If you spend too much time thinking about a thing, you’ll never get it done. – Bruce Lee Read More…
-
Spock: Reading Test Data from CSV File
Following up on my recent post about creating a Spock specification to read the test data from a CSV file without loading all the data into the memory, I created a CSVReader that implements Iterable that allows me to pull this off. You may download the source code here. With this implementation, I can now… Read More…
-
Maven: Plugin Execution Not Covered by Lifecycle Configuration
PROBLEM When running a Maven project in Eclipse or Spring Tool Suite (STS), we get an exception that is similar to this:- SOLUTION This problem stems from m2eclipse (m2e) plugin, which provides Maven support in Eclipse-based IDEs. STEP 1: Suppress the Error Message The simplest solution is to instruct m2e to silently ignore the plugin… Read More…