Friday, 20 September 2013

FAQ: Why do I only see test that fail in IntelliJ and not the tests that pass?


When you run your tests in IntelliJ you may have seen an output where only the failing tests are shown in the run pane tree.

In the above run I have 302 passing tests, but only 1 failed.

Where are my failing tests?

All IDEs offer a massive amount of power and functionality sqeezed into a tiny GUI. So your going to miss things. And one thing people miss, and I've missed it too, is the "Hide Passed" icon.


When this icon is selected you'll not see the passing tests, this allows you to focus on the tests that provided information i.e. 'failure'

If you want to see the passing tests, then click the icon so it is not selected.

Thursday, 19 September 2013

Maven settings.xml - global and user-specific

Sometimes you have to amend the Maven `settings.xml` file to add a proxy or various repositories.

I had to do that a couple of days ago when experimenting with a 3rd party library.

What I sometimes forget, is that there are two `settings.xml` files. Now I shouldn't forget this, because it is quite clear on the Maven Apache site. http://maven.apache.org/settings.html

But I do.

The settings.xml file in

  • `%M2_HOME%/conf/settings.xml` is the global settings.
  • your `.m2` user directory is your user-specific settings.
    • This file doesn't exist until you create it, which might explain why I forget about it.

Duplicate settings in the user-specific file, override the settings in the global settings.

I was reminded of this because of the permission schemes in Windows 7 which wouldn't let me save my global settings without upping my permissions to admin.

You can see the combined settings if you issue the command:

mvn help:effective-settings

Some useful references:

Wednesday, 18 September 2013

Do "Enable Auto-Import" in IntelliJ for "Maven projects need to be imported"


If you see the "Maven projects need to be imported" popup in IntelliJ, then do click "Enable Auto-Import".

You very often see this when you first create new projects and it is easy to miss. But many of my "Why isn't it finding this class" and "Why didn't it import that" queries, are because I haven't noticed the popup sitting patiently in the top right, waiting for me to respond.

Very often the first time you type `@Test` and you know you added JUnit as a dependency, and it runs fine from the command line, but IntelliJ doesn't like it.

If you miss the popup then you can still set the properties using the IntelliJ options


Friday, 13 September 2013

Java For Testers - full set of first draft chapters complete

After a day of writing I have managed to move "Java For Testers" to first draft status.

What does that mean?
  • All of the planned chapters have been added.
I also added an extra two chapters to the sample, the sample (pdf) now includes:
  • Introduction
  • Chapter 001 Basics Of Java Revealed
  • Chapter 002 Install The Necessary Software
  • Chapter 003 Writing Your First Java Code
  • Chapter 004 Test With Other Classes
  • Chapter 022 Next Steps
At 39 pages, the preview is almost 14% of the current draft - a pretty good try before you buy percentage.

Now I have to:
  • re-read it, 
  • check that it makes sense,
  • proof it and look for typos and grammar errors,
  • act on all the reader feedback,
  • check that there are enough examples,
  • add some more exercises,
  • release the source code
I will also increase the minimal price for the book soon. Currently it sits at $4.99. But it has been that price since 50% completion and 100 or so pages, now we are up closer to 94% done and 280 pages.

So if you want to buy the book at the minimal price, it is time to buy Java For Testers now before the price goes up.

Remember that Leanpub offer a 30 day money back guarantee so you can take the risk, and see if this is the book that can help you learn the technical programming skills you need to improve your work.

You can buy Java For Testers over on Leanpub.com

Support Page for Install Chapter on JDK, Maven and IntelliJ

I have left the install chapter in "Java For Testers" to the end, since the installation is pretty simple and really involves working through the official install processes.

But, sometimes things will go wrong.

So I have created an install support page on this site.

It links to the official documentation, and has some 'example' install videos, with links to other troubleshooting guides.

If you experience any issues installing the tools for "Java For Testers" book then let me know.

f you find any useful resources that helped you get started, then let me know and I can add those here too.