You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RobustnessComplex.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.automatedtests.robustness;
  5. import com.vaadin.automatedtests.util.Log;
  6. import com.vaadin.ui.Button;
  7. import com.vaadin.ui.Label;
  8. public class RobustnessComplex extends Robustness implements
  9. Button.ClickListener {
  10. /**
  11. * Create complex layouts with components and listeners.
  12. */
  13. @Override
  14. public void create() {
  15. count++;
  16. // remove old stressLayout, all dependant components should be now
  17. // allowed for garbage collection.
  18. if (stressLayout != null) {
  19. main.removeComponent(stressLayout);
  20. }
  21. // create new stress layout
  22. stressLayout = randomComponents
  23. .getRandomComponentContainer("Component container " + count);
  24. Label label = new Label("Label " + Log.getMemoryStatistics(),
  25. Label.CONTENT_PREFORMATTED);
  26. stressLayout.addComponent(label);
  27. // fill with random components
  28. randomComponents.fillLayout(stressLayout, 50);
  29. // add new component container to main layout
  30. main.addComponent(stressLayout);
  31. // if ((count % 100) == 0) {
  32. System.out.println("Created " + count + " times.");
  33. // }
  34. }
  35. }