Chariot Bloggers
These are extracts of recent articles from Chariot's own consultants, including content from the "official" Chariot Blog and from our own individual blogs. We encourage you to read the original blog article.
My Roo add-ons talk at SpringOne/2GX is approved
09/11/2012
Hello there. I'll be speaking about Spring Roo add-ons again at SpringOne/2GX this year. If you're heading to the show and want to talk shop on Roo and other things, seek me out. I'll be happy to chat.
Here is a link to the talk.
Speaking at SpringOne/2GX - topic - Roo add-ons
08/23/2012
Hello, viewers. I've just received word that I'll be speaking at SpringOne/2GX this year. No link yet but I'm working on that. I'll be down there all week, so I hope to see you there.
Spock's data tables are sweet!
07/08/2012
I'm working with Spock again for updating my CoffeeScript plugin for Roo 1.2.3. There have been a few helpful additions to the add-on APIs (unless I missed them in 1.2.2...) and so my code is getting a tad simpler.
The coolest thing is that converting my tests to Spock, I had an easy way to do a truth table testing condition when I wanted to try out a number of scenarios. Check out this snippet, specifically the "where:" block and the values from the where block variables within the test conditions.
I've switched this test to the more formal given: when: then: syntax, and added the where: section for the data tables settings. I think I was using setup: instead of given: and I also didn't put my expectations in the then: section, which they e...
Now on java.net : my article on WebFlow and Roo from the "Cutting Room Floor" of Roo in Action
06/21/2012
You can read my first java.net article, posted on our behalf from Manning's author articles series, entitled Spring Roo and WebFlow, on Java.Net's technical articles series starting today.
Thanks to Manning's Nermina Miller for helping me get it finished, java.net's Kevin Farnham for publishing it, and Manning's Candace Gillhooley for getting the project going.
I anticipate a few more "cutting room floor" articles, since the book took some twisty turns while Srini and I were formulating the content for the final book.
Here is the output for the counts using Character.getType(int):
COMBINING_SPACING_MARK: 139
CONNECTOR_PUNCTUATION: 12
CONTROL: 65
CURRENCY_SYMBOL: 36
DASH_PUNCTUATION: 17
DECIMAL_DIGIT_NUMBER: 268
ENCLOSING_MARK: 10
END_PUNCTUATION: 64
FINAL_QUOTE_PUNCTUATION: 4
FORMAT: 137
INI...
Command-Line Android Screen Capture with Groovy
I’m writing a chapter about jQuery Mobile for a Manning book, tentatively titled “Mobile Web Apps In Practice”.
I need to get some good, high-quality screen captures for illustrations for the chapter. I read a few articles about how to do a screen capture on an Android device using the ddms tool from the Android sdk, and that worked fine (see, for example, http://forum.gtvhacker.com/gtv-guides/topic59.html if you’re interested). But I figured that there had to be an easier way.
I found Java code for use of the
Spock and Roo - more complex mocks
05/25/2012
Given this method to test:
public boolean isInstalljQueryUICommandAvailable() { String jsLocation = pathResolver.getFocusedIdentifier( Path.SRC_MAIN_WEBAPP, "/js"); if (projectOperations.isFocusedProjectAvailable()) { boolean isMissingjQueryUI = fileManager.findMatchingAntPath( jsLocation + "/jquery-ui-*.min.js").isEmpty(); return !isInstalljQueryCommandAvailable() && isMissingjQueryUI; } else { return false; } }We have several challenges here:
- We are calling the isInstalljQueryCommandAvailable() method from my prior post, so we need to mock the code in that invocation
- We are going to call the same methods with different results
- We have to mock a non-empty call to the findMatchi...
Spock and Roo - Maven's conventions step in to mess with me
05/24/2012
Ok, here's a cautionary tale.
I had everything working just fine in one project using Spock - on Jenkins builds I was getting code coverage working. It was great!
Hey, listen, keep this in mind:
src/test/java is NOT src/main/groovy! Now my jQuery project is starting to use code coverage - go ahead and view the report...
Oh, and one more thing: bind them to test-compile, not test. AAAHH!
:)
Ok, here's my maven build fragment for running the tests (I assume now that the file set is no longer needed...)
org.codehaus.gmaven
Inflection (Pluralization) in Java
Most non-trivial, user-facing software eventually needs to do declension to offer reasonable feedback. Often, simple inflection of nouns is sufficient.
There are some good inflection libraries in other languages, perhaps most notably Damian Conway’s Lingua::EN::Inflect for Perl, and Rails' ActiveSupport::Inflector, but there are surprisingly few good stand-alone implementations for Java.
A search on the web for ‘Java Inflector Library’ will find you references to
