The Holy Java

Building the right thing, building it right, fast

Posts Tagged ‘project’

Release 0.9.9 of Static JSF EL Expression Validator with Annotated Beans Autodetection

Posted by Jakub Holý on February 13, 2012

I’ve released version 0.9.9 of Static JSF EL Expression Validator (tool to check that EL expressions in JSF pages use only existing beans and properties), available for download from Maven Central. The main addition since the last version is the ability to detect managed beans based on annotations instead of reading them from faces-confix.xml or Spring config, thanks to the cool Reflections lib, and support for ui:repeat.

Read the rest of this entry »

Posted in j2ee, Languages, Tools | Tagged: , , , | 2 Comments »

Inspect Your Webapp in a Live Environment Interactively with GroovyConsole

Posted by Jakub Holý on September 27, 2011

Have you ever needed to check the state of your webapp’s objects/Session/.. to find out why the hell something doesn’t work or have you had to learn a weird 3rd party API that is only available on the server? Then you were doomed … until the publication of GroovyConsole. JeeUtils GroovyConsole provides a JSP page that let you execute any Groovy/Java code on the server side, with access to server-side objects like request/session etc.

Here is a screenshot of my recent troubleshooting session, where I needed to check the state of a session-scoped JSF Managed Bean:

Read the rest of this entry »

Posted in j2ee, Languages, Tools | Tagged: , , , , | Comments Off

DbUnit Express 1.3 is Even Easier to Use and Still Better

Posted by Jakub Holý on September 4, 2011

The DbUnit Express 1.3.0 (a thin wrapper around DbUnit to speed up DB testing) released today introduces features that make it even easier to write a DB unit test, the most interesting ones are the introduction of EmbeddedDbTesterRule which can automatically execute its onSetup thanks to JUnit’s @Rule (example) and the addition of setDataSet(fileName), which searches for a data set file of the given name on the classpath etc. and loads it.

See the updated project page and example tests.

Other changes of interest:

  1. The project was now officially renamed to dbunit-express (and root package changed to net.jakubholy.dbunitexpress), so update your Maven dependencies and code
  2. Upgraded to latest DbUnit (2.4.8, was 2.4.7)
  3. Added slf4j-simple to dependencies so that users don’t need to do it themselves anymore – those who don’t want it may just exclude it
  4. Added EmbeddedDbTesterRule which can call its onSetup automatically under JUnit 4
  5. Added setDataSet(String) that tries to find a file of the given name in testData/ or on the classpath and loads it
  6. When there is a FileNotFoundException for the ddl, report the working directory, check if testData/ self exists
  7. Added comment to onTearDown() saying that it does nothing and thus doesn’t need to be called, updated test classes accordingly
  8. Added SimpleNonExtendingEmbeddedDbJUnit4Test to show usage with JUnit 4
  9. When it is detected in onSetup() that the test database likely isn’t initialized, we advice to use Db Creator and report the current working directory
  10. Added method findConfigFile(name) to simplify custom DataSet creation, location of DDL files etc.
  11. Added DatabaseCreator.loadDdl(name) to load an additional DDL, you can also use new DatabaseCreator().setDdlFile(“fileOnClasspathOrInTestData.ddl”).doCreateAndInitializeTestDb() to init the DB from a custom DDL
PS: As you might have noticed, the project was migrated to GitHub because I couldn’t stand Subversion anymore. Its inability to deal with deleted folders was killing me.

Posted in Languages, Testing | Tagged: , , | Comments Off

Validating JSF EL Expressions in JSF Pages with static-jsfexpression-validator

Posted by Jakub Holý on June 22, 2011

Update: Version 1.0 was released in March 2012
Update: Version 0.9.9 with finished basic support for Facelets
(autodetection of annotated beans, handling of ui:repeat) is available
Update: Version 0.9.7 with experimental Facelets support and a fix of method binding validation released in Nov. (Not mentioning 0.9.5 and .6.) Always check the latest version available! The text below would need to be updated for the new API, which will be done by the end of 2011.
Update: Version 0.9.3 with new group/artifactId released
on 7/25 including native support for JSF 1.2 (reflected below in the pom snippet).
Update: Version 0.9.4 with function tolerance for JSF 1.2 released on 7/28 (it doesn’t check functions are OK but checks their parameters etc.)

static-jsfexpression-validator is utility for verifying that EL expressions in JSF pages, such as #{}, are correct, that means that they don’t reference undefined managed beans and nonexistent getters or action methods. The purpose is to make JSF-based web applications safer to refactor as the change of a method name will lead to the detection of an invalid expression without need for extensive manual UI tests. It can be run statically, for example from a test. Currently it builds on the JSF implementation v. 1.1 but can be in few hours (or days) modified to support newer version of JSF. How does it work?

Read the rest of this entry »

Posted in j2ee, Languages, Tools | Tagged: , , | 3 Comments »