diff options
author | elmot <elmot@vaadin.com> | 2016-11-10 17:32:51 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-11-11 19:47:10 +0000 |
commit | 55ac10703f033dcd444d20f9be419be3e91aa73f (patch) | |
tree | 8d5b2665d4d3b660e41d0ead81b8b2f54fd15eac /compatibility-server | |
parent | c0d712cdbea886ea299644144bd6d7445cecec44 (diff) | |
download | vaadin-framework-55ac10703f033dcd444d20f9be419be3e91aa73f.tar.gz vaadin-framework-55ac10703f033dcd444d20f9be419be3e91aa73f.zip |
Fix DeprecatedTest under Windows
Change-Id: I06d8e631448e419536dfbb9188a5934c6a7bad37
Diffstat (limited to 'compatibility-server')
-rw-r--r-- | compatibility-server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java | 11 | ||||
-rw-r--r-- | compatibility-server/src/test/java/com/vaadin/tests/server/DeprecatedTest.java | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/compatibility-server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java b/compatibility-server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java index d32718196b..97005966f3 100644 --- a/compatibility-server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java +++ b/compatibility-server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java @@ -21,12 +21,13 @@ import java.util.stream.Stream; * <p> * The methods in the class return all real (not anonymous and not private) * classes from the filtered classpath. - * + * * @author Vaadin Ltd * */ class ClasspathHelper { + public static final String COM_VAADIN_FILE_PREFIX = "com" + File.separatorChar + "vaadin" + File.separatorChar; private final Predicate<String> skipClassesFilter; ClasspathHelper(Predicate<String> skipClassesFilter) { @@ -57,7 +58,7 @@ class ClasspathHelper { .filter(path -> path.toFile().getName() .endsWith(".class")) .filter(path -> classesRoot.toPath().relativize(path) - .toString().contains("com/vaadin/")) + .toString().contains(COM_VAADIN_FILE_PREFIX)) .map(path -> getClassFromFile(path, classesRoot.toPath())) .filter(Objects::nonNull).collect(Collectors.toList()); @@ -66,12 +67,12 @@ class ClasspathHelper { URI uri = URI.create("jar:file:" + classesRoot.getPath()); Path root = FileSystems .newFileSystem(uri, Collections.emptyMap()) - .getPath("/"); + .getPath(File.separator); return Files.walk(root).filter(Files::isRegularFile) .filter(path -> path.toUri().getSchemeSpecificPart() .endsWith(".class")) .filter(path -> root.relativize(path).toString() - .contains("com/vaadin/")) + .contains(COM_VAADIN_FILE_PREFIX)) .map(path -> getClassFromFile(path, root)) .filter(Objects::nonNull).collect(Collectors.toList()); } @@ -85,7 +86,7 @@ class ClasspathHelper { Path relative = root.relativize(path); String name = relative.toString(); name = name.substring(0, name.length() - ".class".length()); - name = name.replace('/', '.'); + name = name.replace(File.separatorChar, '.'); if (skipClassesFilter.test(name)) { return null; } diff --git a/compatibility-server/src/test/java/com/vaadin/tests/server/DeprecatedTest.java b/compatibility-server/src/test/java/com/vaadin/tests/server/DeprecatedTest.java index 671fc65080..ab04f0616a 100644 --- a/compatibility-server/src/test/java/com/vaadin/tests/server/DeprecatedTest.java +++ b/compatibility-server/src/test/java/com/vaadin/tests/server/DeprecatedTest.java @@ -45,7 +45,7 @@ public class DeprecatedTest { + " is in compatability package and it's not deprecated", cls.getAnnotation(Deprecated.class)); }); - Assert.assertTrue(count.get() > 0); + Assert.assertNotEquals("Total number of checked classes", 0, count.get()); } } |