How can I provide users with the functionality of the DBUnit DatabaseOperation methods from a web in

Posted by reckoner on Stack Overflow See other posts from Stack Overflow or by reckoner
Published on 2010-01-07T14:21:40Z Indexed on 2010/05/22 2:00 UTC
Read the original article Hit count: 286

I am currently updating a java-based web application which allows database developers to create stored procedure regression test suites for database testing.

Currently, for test setup, execution and clean-up stages, the user is provided with text boxes where they are able to enter SQL code which is executed by the isql command.

I would like to extend the application to use DB Unit’s DatabaseOperation methods to provide more ways to setup the state of the database than just SQL statements. The main reason for using Db Unit rather than just SQL statements is to be able to create and store xml and xls DataSets on a server where they can be associated with their test cases and used for data setup.

My question is:

How can I provide users with the functionality of the DBUnit DatabaseOperation methods from a web interface?

I have considered:

  1. Creating a simple programming language and a parser to read some simple syntax involving the DB Unit method names which accept a parameter being the file location to an xml or xls DataSet. I was thinking of allowing the user to register the files they need with the web app which would catalogue them and provide each file with an identifier which could passed as a parameter to the methods in this simple programming language.

  2. Creating an XML DTD which provides the user with the ability to specify operations and parameters. If I went this approach, how can I execute the methods and their parameters that I parse from the XML document?

  3. Creating a table in the database which stores the method and a FK relation to a catalogued DataSet file, however I don’t think this would be good solution due to the fact that data entry would be tedious.

Thanks for your help.

© Stack Overflow or respective owner

Related posts about sql

Related posts about web-applications