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 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.client;
  17. import junit.framework.TestCase;
  18. import org.junit.Assert;
  19. import com.vaadin.client.componentlocator.LocatorUtil;
  20. /*
  21. * Test LocatorUtil.isUIElement() & isNotificaitonElement methods
  22. */
  23. public class LocatorUtilTest extends TestCase {
  24. public void testIsUI1() {
  25. boolean isUI = LocatorUtil.isUIElement("com.vaadin.ui.UI");
  26. Assert.assertTrue(isUI);
  27. }
  28. public void testIsUI2() {
  29. boolean isUI = LocatorUtil.isUIElement("/com.vaadin.ui.UI");
  30. Assert.assertTrue(isUI);
  31. }
  32. public void testIsUI3() {
  33. boolean isUI = LocatorUtil
  34. .isUIElement("//com.vaadin.ui.UI[RandomString");
  35. Assert.assertTrue(isUI);
  36. }
  37. public void testIsUI4() {
  38. boolean isUI = LocatorUtil.isUIElement("//com.vaadin.ui.UI[0]");
  39. Assert.assertTrue(isUI);
  40. }
  41. public void testIsNotification1() {
  42. boolean isUI = LocatorUtil
  43. .isNotificationElement("com.vaadin.ui.VNotification");
  44. Assert.assertTrue(isUI);
  45. }
  46. public void testIsNotification2() {
  47. boolean isUI = LocatorUtil
  48. .isNotificationElement("com.vaadin.ui.Notification");
  49. Assert.assertTrue(isUI);
  50. }
  51. public void testIsNotification3() {
  52. boolean isUI = LocatorUtil
  53. .isNotificationElement("/com.vaadin.ui.VNotification[");
  54. Assert.assertTrue(isUI);
  55. }
  56. public void testIsNotification4() {
  57. boolean isUI = LocatorUtil
  58. .isNotificationElement("//com.vaadin.ui.VNotification[0]");
  59. Assert.assertTrue(isUI);
  60. }
  61. }