I don't know. Did not test that, just offer a possible solution
chillworld ( 2016-01-12 15:21:41 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
In our project we had the need to implement our id generator, but we just want to use it in test environment.
We cannot use the configuration described in:
http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/Testing/Testing%20Tips
Because we have restricted access to environment configurations.
We tried to define the id generator in WebAppInit:
wapp.getConfiguration().setIdGeneratorClass(CustomIdGenerator.class)
But has no effect.
How can i change the configuration without change ZK.xml?
Thank you all :)
A solution could be making a delegater CustomIdGenerator.
What do I mean with this, it's acting as a IdGenerator but has internally an other IdGenerater instance. So your methods just contain :
public void doX() {
generator.doX();
}
But now you could instantiate the generator by yourself and in order if it's a test environment, you intantiate the testing Id generator, otherwise you set the other one.
Greetz chill.
I don't know. Did not test that, just offer a possible solution
chillworld ( 2016-01-12 15:21:41 +0800 )editHello eclipse1,
Also please check out the following:
http://books.zkoss.org/wiki/SmallTalks/2009/February/HowtoTestZKApplicationwith_Selenium
Best Regards,
Darksu
Asked: 2016-01-08 14:20:27 +0800
Seen: 22 times
Last updated: Jan 10 '16
Thank you all for your answers, we decided to create a maven property configuration to change the value of the ID Generator.
eclipse1 ( 2016-01-19 09:16:03 +0800 )edit