/com.plugin.log4j.viewer/uitests/com/log4jviewer/ui/views/StartStopServerButtonsTest.java

https://code.google.com/p/log4j-viewer/ · Java · 29 lines · 19 code · 5 blank · 5 comment · 0 complexity · 842bf0888332514590bc4798b20b1144 MD5 · raw file

  1. package com.log4jviewer.ui.views;
  2. import org.junit.Test;
  3. /**
  4. *
  5. * @author <a href="mailto:Daniil.Yaroslavtsev@gmail.com"> Daniil Yaroslavtsev </a>
  6. *
  7. */
  8. public class StartStopServerButtonsTest extends AbstractMainViewTest {
  9. @Test
  10. public void testStartStopServerButtonsInitialState() {
  11. assertTrue(getStartLog4jServerButton().isEnabled());
  12. assertFalse(getStopLog4jServerButton().isEnabled());
  13. }
  14. @Test
  15. public void testStartStopServerButtonsSelection() {
  16. selectStartLog4jServerButton();
  17. assertFalse(getStartLog4jServerButton().isEnabled());
  18. assertTrue(getStopLog4jServerButton().isEnabled());
  19. sleep(200);
  20. selectStopLog4jServerButton();
  21. assertTrue(getStartLog4jServerButton().isEnabled());
  22. assertFalse(getStopLog4jServerButton().isEnabled());
  23. }
  24. }