From 92f9b378dd6cccc2782ae143f7d7209bf1c00a5e Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 6 Aug 2018 11:09:35 +0300 Subject: [PATCH] Exclude all classes in 'test-classes' from the serialization test (#4483) * Exclude all classes in 'test-classes' from the serialization test --- .../vaadin/flow/testutil/ClassesSerializableTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flow-test-generic/src/main/java/com/vaadin/flow/testutil/ClassesSerializableTest.java b/flow-test-generic/src/main/java/com/vaadin/flow/testutil/ClassesSerializableTest.java index 195c634d4c4..b42a81e2779 100644 --- a/flow-test-generic/src/main/java/com/vaadin/flow/testutil/ClassesSerializableTest.java +++ b/flow-test-generic/src/main/java/com/vaadin/flow/testutil/ClassesSerializableTest.java @@ -144,6 +144,11 @@ protected Stream getExcludedPatterns() { "com\\.vaadin\\.flow\\.templatemodel\\.BeanContainingBeans(\\$.*)?"); } + protected boolean isTestClassPath(String classPath) { + File file = new File(classPath); + return "test-classes".equals(file.getName()); + } + /** * Performs actual serialization/deserialization * @@ -285,7 +290,9 @@ public void classesSerializable() throws Throwable { List classes = new ArrayList<>(); List excludes = getExcludedPatterns().map(Pattern::compile).collect(Collectors.toList()); for (String location : rawClasspathEntries) { - classes.addAll(findServerClasses(location, excludes)); + if (!isTestClassPath(location)) { + classes.addAll(findServerClasses(location, excludes)); + } } ArrayList nonSerializableFunctionFields = new ArrayList<>();