public void test() throws Exception {
for (int i = 0; i < 90000; i += 300) {
final int i_copy = i;
IModelReloader reloader = new IModelReloader() {
@Override
public EObject reload() throws InferenceException {
try {
InternetApplication root = (InternetApplication) DroolsPerformanceTest.this.reload();
ICreateElementsFactory factory = CachedModelInferer.getInstance().createCreateElementsFactory();
EcoreCreateElementsHelper handler = (EcoreCreateElementsHelper) factory.createHandler(root);
// add the pages etc
for (int j = 0; j < i_copy; j++) {
Frame page = handler.createFrame(root);
page.setName("test page " + j);
/*
Button button = (Button) handler.createElement(page, VisualPackage.eINSTANCE.getButton(), ModelPackage.eINSTANCE.getInternetApplication_Children());
button.setName("test button " + j);
*/
InputTextField text = (InputTextField) handler.createElement(page, VisualPackage.eINSTANCE.getInputTextField(), VisualPackage.eINSTANCE.getFrame_Children());
text.setName("test field " + j);
}
return root;
} catch (ModelLoadException e) {
throw new InferenceException(e);
}
}
};
InternetApplication root = (InternetApplication) reloader.reload();
infer(root, false, reloader);
}
}