Showing posts from November, 2011

Using PODAM - POjo Data Mocker

In each unit testing process, providing various mock objects systematically allows testing diversified cases of software code. In this manner, entity beans or plain old java objects(POJO) can be simply mocked with using PODAM API (developed by Marco Tedone ). This library is comprehensive enough to cover the basics of mocking POJOs and also flexible to develop custom data provider strategies with implementing DataProviderStrategy interface. Metadata constraints such as min-max value of an integer attribute can be created with PODAM annotations that will be evaluated at runtime.  In order to start using Podam mock objects, podam-3.0.x.jar and log4j-1.2.x.jar must be added to buildpath of your project. Since, podam-3.0.x is depending on log4j. I used Gallery and Category classes and used the code snippet to generate mock objects. CODE SNIPPET PodamFactory factory = new PodamFactoryImpl(); Gallery gallery = factory.manufacturePojo(Gallery.class); System.out.println(gallery); CO

SoapUI JDBC Datasource Configuration for MySQL Database

Using each of existing valid test data can be extremely difficult while using huge amount of test data(e.g. 10.000 customers) . SoapUI has datasource feature that automates retrieving test data from existing datasources such as raw files, excel or databases. Accessing huge test data with datasources enhances automated tests with reducing required time to make more tests for finding bugs that are hidden in unexpected cases. Obviously, raw and excel files hold static data that might possibly become obsolete, since test data is not constant and updated through in test progress. Gathering test data directly from test database solves this problem.  In order to add JDBC datasource; first, place the jar file of jdbc driver for your database (e.g. mysql-connector-java-5.1.13-bin.jar for MySQL) to %SOAPUI_INSTALL_DIR%\lib , then follow the screenshots below. 1. First add datasource to your test suite in SoapUI , then add a property -> select datasource type as JDBC -> Configure Dat