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.

LocatorUtilTest.java 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.vaadin.client;
  2. import static org.junit.Assert.assertTrue;
  3. import org.junit.Test;
  4. import com.vaadin.client.componentlocator.LocatorUtil;
  5. /*
  6. * Test LocatorUtil.isUIElement() & isNotificaitonElement methods
  7. */
  8. public class LocatorUtilTest {
  9. @Test
  10. public void testIsUI1() {
  11. boolean isUI = LocatorUtil.isUIElement("com.vaadin.ui.UI");
  12. assertTrue(isUI);
  13. }
  14. @Test
  15. public void testIsUI2() {
  16. boolean isUI = LocatorUtil.isUIElement("/com.vaadin.ui.UI");
  17. assertTrue(isUI);
  18. }
  19. @Test
  20. public void testIsUI3() {
  21. boolean isUI = LocatorUtil
  22. .isUIElement("//com.vaadin.ui.UI[RandomString");
  23. assertTrue(isUI);
  24. }
  25. @Test
  26. public void testIsUI4() {
  27. boolean isUI = LocatorUtil.isUIElement("//com.vaadin.ui.UI[0]");
  28. assertTrue(isUI);
  29. }
  30. @Test
  31. public void testIsNotification1() {
  32. boolean isUI = LocatorUtil
  33. .isNotificationElement("com.vaadin.ui.VNotification");
  34. assertTrue(isUI);
  35. }
  36. @Test
  37. public void testIsNotification2() {
  38. boolean isUI = LocatorUtil
  39. .isNotificationElement("com.vaadin.ui.Notification");
  40. assertTrue(isUI);
  41. }
  42. @Test
  43. public void testIsNotification3() {
  44. boolean isUI = LocatorUtil
  45. .isNotificationElement("/com.vaadin.ui.VNotification[");
  46. assertTrue(isUI);
  47. }
  48. @Test
  49. public void testIsNotification4() {
  50. boolean isUI = LocatorUtil
  51. .isNotificationElement("//com.vaadin.ui.VNotification[0]");
  52. assertTrue(isUI);
  53. }
  54. }