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.

DeprecatedTest.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.vaadin.tests.server;
  2. import static org.junit.Assert.assertNotEquals;
  3. import static org.junit.Assert.assertNotNull;
  4. import java.io.File;
  5. import java.net.URISyntaxException;
  6. import java.util.concurrent.atomic.AtomicInteger;
  7. import org.junit.Test;
  8. /**
  9. * @author Vaadin Ltd
  10. *
  11. */
  12. public class DeprecatedTest {
  13. @Test
  14. public void allTypesAreDeprecated() throws URISyntaxException {
  15. AtomicInteger count = new AtomicInteger(0);
  16. File testRoot = new File(DeprecatedTest.class.getResource("/").toURI());
  17. new ClasspathHelper()
  18. .getVaadinClassesFromClasspath(
  19. entry -> entry.contains("compatibility-server")
  20. && !testRoot.equals(new File(entry)))
  21. .forEach(cls -> {
  22. count.incrementAndGet();
  23. assertNotNull("Class " + cls
  24. + " is in compatability package and it's not deprecated",
  25. cls.getAnnotation(Deprecated.class));
  26. });
  27. assertNotEquals("Total number of checked classes", 0, count.get());
  28. }
  29. }