1 2 Previous Next 15 Replies Latest reply on May 24, 2012 9:35 AM by rhauch Go to original post
      • 15. Re: JDBC query - NPE
        rhauch

        I'll try to put together a list of what I know is required and/or doesn't work. As I mentioned earlier I have it mostly working with SQuirreLSQL now. Some of the changes required were just to change not implemented exceptions to return empty strings or array for capabilities (in most cases I think the empty return value is quite valid).

        That'd be awesome.

        As far as testing is involved, I would like to have a test case that exercised the various JDBC interfaces but that would require some sort of backend when running the tests. Do you have something like this supported during your builds? Unit tests for this sort of thing are difficult since it is just an interface to a server and stubbing that out can be a lot of work and hard to maintain.

        We do have several JUnit tests that start a Jetty server with the ModeShape REST service (deployed as a WAR file). Maven does most of the work there, as you can see by this section of the POM for 'modeshape-web-jcr-rest-war'. The JcrResourcesTest is the JUnit test that uses the REST client to talk to "http://localhost:8090". There's something similar for the 'modeshape-jbossas-web-rest-war' module.

         

        It probably makes sense to change the 'modeshape-jdbc' module to do something similar, but use the JDBC driver in the JUnit test rather than the REST client. This would be pretty straightforward.

         

        In 3.0 I'd like to start moving away from using Jetty and start using AS7 and Arquillian, but I haven't yet had the chance to convert our tests. Among others, the Teiid project is already doing this, so if you're brave and interested this might be an option. The Teiid project has several tests we could use as examples, plus one of the test module's POM is interesting because it (a) downloads and unpacks the JBoss AS7 instance from the Maven repository into the target directory, (b) unpacks Teiid's AS7 kit (similar to ours), and (c) configures Surefire to start up the AS7 server before the tests run. We could definitely use the same POM operations in our 'modeshape-jbossas-web-rest-war' (or even a new 'modeshape-jbossas-jdbc-test' module). For the 'modeshape-web-jcr-rest-war' module (or even the 'modeshape-jdbc' module), a little modification could simply copy the WAR file and a ".dodeploy" to the correct location (rather than unpack the AS7 ModeShape kit).

        1 2 Previous Next