Done - already commited in the trunk.
This test case shows what you can do:
| public void testMatching() throws Throwable
| {
| setBeanMetaDatas();
|
| ControllerContext regexpDemand = assertInstall(0, "regexpDemander",
getState());
| assertInstall(1, "regexpSupplier");
| assertEquals(ControllerState.INSTALLED, regexpDemand.getState());
|
| ControllerContext limitDemand = assertInstall(2, "intervalDemander",
getState());
| assertInstall(3, "intervalSupplier");
| assertEquals(ControllerState.INSTALLED, limitDemand.getState());
|
| ControllerContext customDemand = assertInstall(4, "customDemander",
getState());
| assertInstall(5, "customSupplier");
| assertEquals(ControllerState.INSTALLED, customDemand.getState());
| }
|
| protected ControllerState getState()
| {
| return ControllerState.PRE_INSTALL;
| }
|
| protected void setBeanMetaDatas() throws Throwable
| {
| BeanMetaDataBuilder b0 =
BeanMetaDataBuilderFactory.createBuilder("regexpDemander",
Object.class.getName());
| b0.addDemand("^[a-zA-Z0-9._%+-]+(a)acme\\.((org)|(com))$", null,
"regexp");
| BeanMetaDataBuilder b1 =
BeanMetaDataBuilderFactory.createBuilder("regexpSupplier",
Object.class.getName());
| b1.addSupply("aj(a)acme.org");
|
| BeanMetaDataBuilder b2 =
BeanMetaDataBuilderFactory.createBuilder("intervalDemander",
Object.class.getName());
| b2.addDemand("(1,10]", null, "interval");
| BeanMetaDataBuilder b3 =
BeanMetaDataBuilderFactory.createBuilder("intervalSupplier",
Object.class.getName());
| b3.addSupply("5", "java.lang.Integer");
|
| BeanMetaDataBuilder b4 =
BeanMetaDataBuilderFactory.createBuilder("customDemander",
Object.class.getName());
| b4.addDemand("fragment", null,
CustomMatcherTransfomer.class.getName());
| BeanMetaDataBuilder b5 =
BeanMetaDataBuilderFactory.createBuilder("customSupplier",
Object.class.getName());
| b5.addSupply("i supply fragment word");
|
| setBeanMetaDatas(new BeanMetaData[]
| {
| b0.getBeanMetaData(),
| b1.getBeanMetaData(),
| b2.getBeanMetaData(),
| b3.getBeanMetaData(),
| b4.getBeanMetaData(),
| b5.getBeanMetaData(),
| }
| );
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099884#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...