diff options
Diffstat (limited to 'src/com/itmill/toolkit/automatedtests/robustness/RobustnessComplex.java')
-rw-r--r-- | src/com/itmill/toolkit/automatedtests/robustness/RobustnessComplex.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/automatedtests/robustness/RobustnessComplex.java b/src/com/itmill/toolkit/automatedtests/robustness/RobustnessComplex.java new file mode 100644 index 0000000000..4f9325693d --- /dev/null +++ b/src/com/itmill/toolkit/automatedtests/robustness/RobustnessComplex.java @@ -0,0 +1,43 @@ +/* +@ITMillApache2LicenseForJavaFiles@ + */ + +package com.itmill.toolkit.automatedtests.robustness; + +import com.itmill.toolkit.automatedtests.util.Log; +import com.itmill.toolkit.ui.Button; +import com.itmill.toolkit.ui.Label; + +public class RobustnessComplex extends Robustness implements + Button.ClickListener { + + /** + * Create complex layouts with components and listeners. + */ + public void create() { + count++; + + // remove old stressLayout, all dependant components should be now + // allowed for garbage collection. + if (stressLayout != null) + main.removeComponent(stressLayout); + + // create new stress layout + stressLayout = randomComponents + .getRandomComponentContainer("Component container " + count); + + Label label = new Label("Label " + Log.getMemoryStatistics(), + Label.CONTENT_PREFORMATTED); + stressLayout.addComponent(label); + + // fill with random components + randomComponents.fillLayout(stressLayout, 50); + + // add new component container to main layout + main.addComponent(stressLayout); + + // if ((count % 100) == 0) { + System.out.println("Created " + count + " times."); + // } + } +} |