//import com.vanward.resource.hibernate.factory.DefaultHibernateSessionFactory /** * Tests VM version from environment- note, even 1.5 will * cause an assertion error. */ def testVMVersion(){ println "

JVM Version Check:

" vers = System.getProperty("java.version") //assert vers.startsWith("1.4"): "JVM must be at least 1.4" println "

JVM version: ${vers}

" } /** * Attempts to create an instance of a hibernate session. If this * works we have a connection to a database; additionally, we * have a properly configured hibernate instance. */ /* def testHibernate(){ println "

Hibernate Configuration Check:

" try{ sessFactory = DefaultHibernateSessionFactory.getInstance() session = sessFactory.getHibernateSession() assert session != null: "Unable to create hibernate session. Session was null" println "

Hibernate configuration check was successful

" }catch(Throwable tr){ println """

Unable to create hibernate session. Exception type is:
${tr.toString()}

""" } } */ println """ Diagnostics Check

Diagnostics Check

""" testVMVersion() //testHibernate() println """ """