Hello guys,

I've released the first plublic version (1.0.1) of a simple tool : XMLStubs.

It allows you to replace an API defined by interfaces by an emulated one declared in 
XML files. Jexl language (same as
JSP EL) is used to add conditional behaviour.

For example, if you need some implementation of IObject :

public interface IObject
{
    int getIntValue(String name);
}

You can define a stub for this interface like this :
<stub-beans dateFormat="dd/MM/yyyy">
        <stub-bean id="test" implements="net.sf.azote.xmlstubs.Interface">
                <method signature="getIntValue(java.lang.String)">
                        <case condition="arg0 eq '4'">
                                <value>4</value>
                        </case>
                        <case condition="arg0 eq '12'">
                                <value>12</value>
                        </case>
                        <case>
                                <throw throwable="java.lang.IllegalArgumentException"/>
                        </case>
                </method>
        </stub-bean>
</stub-beans>It can return simple types, other stubs from interfaces, collections, 
maps, javabeans (using default
constructor + setters) and result from static method calls (usefull for ValuedEnum)

I use it on my apps to build and make demos of the webapp while business tier is still 
in dev.

It comes with simple support for Springframework, junit, dbunit and StrutsTestCase : 
when you run a test, it loads an
XML file with same name as the test class to get stubs you can use in your test.

http://azote.sourceforge.net/xmlstubs.html


Nico.




Our name has changed, please update your address book to the following format for the 
latest identities received "[EMAIL PROTECTED]".

This message contains information that may be privileged or confidential and is the 
property of the Capgemini Group. It is intended only for the person to whom it is 
addressed. If you are not the intended recipient,  you are not authorized to read, 
print, retain, copy, disseminate,  distribute, or use this message or any part 
thereof. If you receive this  message in error, please notify the sender immediately 
and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to