Posts

Showing posts from June, 2011

Simple Java Formatting Tool

Image
Representation of numbers, currencies, percentage, date and time values generally varies between countries(e.g. today is in Italy 28-giu-2011 , but in Ireland 28-Jun-2011 ). Instead of customizing each date, time, number etc. format for what local area required, java formatting api should be used. Not only localization but also custom formatting date, time and numbers are possible with this api. I implemented a simple java desktop application that has text fields with default values(123456789)  that indicates: how date and time will be formatted in selected format style and country how date and number will be for with given formats how currency, number and percentage should be represented in selected country Java Formatting Demo Application Download Java Formatting Demo Application with Netbeans Project

SoapUI - Dynamic Properties - Getting Current Time in DateTime Format

Image
SoapUI satisfies the need of testing service oriented applications with test suites that depends on client scenarios. SoapUI enhances its test suite facility with Groovy scripts to create dynamic properties that helps functional testing. The example in soapUI website demonstrates how to retrieve current date in xsd:date format (yyyy-MM-dd). I am not very keen on Groovy but after a bit effort, i implemented this code snippet that returns the current date in xsd:dateTime format. I hope it helps... def dateTimeFormat = "yyyy-MM-dd'T'hh:mm:ss'Z'" def timeZone = TimeZone.getTimeZone("Etc/GMT") def dateTimeFormatter = new java.text.SimpleDateFormat(dateTimeFormat) dateTimeFormatter.setTimeZone(timeZone) return dateTimeFormatter.format(new java.util.Date()) SoapUI DataGen Test Suite Facility SoapUI is not only sending-receiving soap messages, great testing environment tools and Groovy script support makes it valueble.Do not commit any implementation