-
MoreUnit
In Eclipse I missed a way to see the relation between a test class and the class under test. Well, the MoreUnit plugin relates the two and offers tools to help you switch between code of the test and the tested class. From the site:
- MoreUnit decorates classes which have a test case.
- It marks methods in the editor which are under test.
- You can jump to a test case/test method in the editor via the menu or a shortcut (Ctrl-J by default).
- You can run a test case/test method from the class under test via the menu or a shortcut (Ctrl-R by default).
- Rename classes/methods and MoreUnit will rename the corresponding test code too.
- Move classes and MoreUnit will move the corresponding test cases.
- You can generate a test method stub for the method under the cursor in the editor via the menu or a shortcut.
All useful features to help writing and managing the unit tests of your Java classes. You do write unit tests, do you?
-
To use localStorage in Firefox cookies must be allowed
In case a JavaScript generates a security error in Firefox when using localStorage, I found the advice to make sure the about:config property dom.storage.enabled to true.
But this is not enough! localStorage is only available if cookies are allowed for the domain that serves the web page with the script.
I find this strange, cookies are completely different things.
-
Experiences with Maven 3: Generating reports
After installing version 3 of Maven I missed the generation of the documentation site. While the documentation claims no changes to POM files are necessary to use the newer version it doesn’t behave the same.
Version 3 accepts the same POM files used with version 2, but the site goal no longer generates any output. This is because of a change in the POM structure. The configuration of reports has moved from a separate
<reporting>section to the<build>section:<build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.0-beta-3</version> <configuration> <reportPlugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.4</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.8</version> <configuration> <quiet>true</quiet> </configuration> </plugin> </reportPlugins> </configuration> </plugin> ... </plugins> </build>To generate the general project information reports you automatically get with Maven 2, add the maven-project-info-reports-plugin.
-
Smaller classes make better code
Tip: read In Praise of Small Classes and its follow-up Making Large Classes Small (In 5 Not-So-Easy Steps) about writing better code. Better here means:
- easier to read and understand, so easier to maintain
- less complex classes
- better testable classes
- a better class and package structure