Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ProgressBarDeclarativeTest.java 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.server.component.progressbar;
  17. import org.junit.Test;
  18. import com.vaadin.tests.design.DeclarativeTestBase;
  19. import com.vaadin.ui.ProgressBar;
  20. /**
  21. * Test cases for reading the properties of selection components.
  22. *
  23. * @author Vaadin Ltd
  24. */
  25. public class ProgressBarDeclarativeTest extends
  26. DeclarativeTestBase<ProgressBar> {
  27. public String getBasicDesign() {
  28. return "<vaadin-progress-bar value=0.5 indeterminate>";
  29. }
  30. public ProgressBar getBasicExpected() {
  31. ProgressBar ns = new ProgressBar();
  32. ns.setIndeterminate(true);
  33. ns.setValue(0.5f);
  34. return ns;
  35. }
  36. @Test
  37. public void testReadBasic() {
  38. testRead(getBasicDesign(), getBasicExpected());
  39. }
  40. @Test
  41. public void testWriteBasic() {
  42. testWrite(stripOptionTags(getBasicDesign()), getBasicExpected());
  43. }
  44. @Test
  45. public void testReadEmpty() {
  46. testRead("<vaadin-progress-bar>", new ProgressBar());
  47. }
  48. @Test
  49. public void testWriteEmpty() {
  50. testWrite("<vaadin-progress-bar>", new ProgressBar());
  51. }
  52. @Test
  53. public void testReadOnlyValue() {
  54. String design = "<vaadin-progress-bar readonly value=0.5 indeterminate>";
  55. ProgressBar progressBar = new ProgressBar();
  56. progressBar.setIndeterminate(true);
  57. progressBar.setValue(0.5f);
  58. progressBar.setReadOnly(true);
  59. testRead(design, progressBar);
  60. testWrite(design, progressBar);
  61. }
  62. }